Browse Source

时间格式

master
牧羊人 4 years ago
parent
commit
7229bacaa7
4 changed files with 9 additions and 9 deletions
  1. +2
    -2
      src/main/java/com/taauav/admin/dto/TauvReportDTO.java
  2. +2
    -2
      src/main/java/com/taauav/admin/dto/TauvReportInputDTO.java
  3. +2
    -2
      src/main/java/com/taauav/admin/entity/TauvReport.java
  4. +3
    -3
      src/main/java/com/taauav/admin/service/impl/TauvReportServiceImpl.java

+ 2
- 2
src/main/java/com/taauav/admin/dto/TauvReportDTO.java View File

@@ -52,8 +52,8 @@ public class TauvReportDTO extends BaseReportDTO {
/**
* 生成报告时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date inputTime;

/**

+ 2
- 2
src/main/java/com/taauav/admin/dto/TauvReportInputDTO.java View File

@@ -22,8 +22,8 @@ public class TauvReportInputDTO extends BaseReportDTO {
private Integer inputUser;
private String formatInputUser;
private Integer num;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date inputTime;
private String formatInputTime;
}

+ 2
- 2
src/main/java/com/taauav/admin/entity/TauvReport.java View File

@@ -174,8 +174,8 @@ public class TauvReport extends Entity {
/**
* 创建时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date inputTime;

/**

+ 3
- 3
src/main/java/com/taauav/admin/service/impl/TauvReportServiceImpl.java View File

@@ -108,7 +108,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau
Integer[] status = {1, 4};
map.put("status", status);
}
if (map.containsKey("driverArea") && !"".equals(map.get("driverArea"))) {
if (map.containsKey("driverArea") && !StringUtils.isEmpty(map.get("driverArea"))) {
map.put("driverArea", BigInteger.valueOf(Long.valueOf(map.get("driverArea").toString())));
} else {
map.remove("driverArea");
@@ -301,7 +301,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau
reportInputDTO.setFormatInputUser(StringUtils.isEmpty(inputUser) ? "" : inputUser.getRealname());
}
if (!StringUtils.isEmpty(reportInputDTO.getInputTime())) {
reportInputDTO.setFormatInputTime(DateUtil.format(reportInputDTO.getInputTime(), format));
reportInputDTO.setFormatInputTime(DateUtil.format(reportInputDTO.getInputTime(), "yyyy-MM-dd"));
}
TauvInspectDriver driver = inspectDriverMapper.selectById(reportInputDTO.getInspectDriverId());
reportInputDTO.setNum(driver.getNum());
@@ -847,7 +847,7 @@ public class TauvReportServiceImpl extends BaseServiceImpl<TauvReportMapper, Tau
}
if (reportDTO.getInputTime() != null) {
reportDTO.setCreateTime(reportDTO.getInputTime());
reportDTO.setFormatInputTime(DateUtil.format(reportDTO.getInputTime(), "yyyy-MM-dd HH:mm:ss"));
reportDTO.setFormatInputTime(DateUtil.format(reportDTO.getInputTime(), "yyyy-MM-dd"));
} else {
reportDTO.setFormatInputTime("");
}

Loading…
Cancel
Save