fix 筹备列表 开店时间错误,导出也是

This commit is contained in:
shuo.wang
2024-11-14 19:06:18 +08:00
parent 9e1e02aac1
commit 486d33323f
4 changed files with 6 additions and 7 deletions

View File

@@ -45,7 +45,7 @@ public class PreparationScheduleDTO {
@ApiModelProperty("计划开店时间")
private String planOpenTime;
@ExcelProperty("开店时长(小时)")
@ExcelProperty("开店时长()")
@ColumnWidth(30)
@ApiModelProperty("开店时长")
private String days;

View File

@@ -68,13 +68,14 @@ public class PreparationScheduleVO {
private Date shopCreateTime;
public void setDays() {
if (this.openingActivityEndTime==null){
long between = ChronoUnit.SECONDS.between(new Date().toInstant(), this.shopCreateTime.toInstant());
long between = ChronoUnit.SECONDS.between(this.shopCreateTime.toInstant(), new Date().toInstant());
double days = (double) between / (24*60*60);
this.days=String.format("%.1f", days);
}else{
long between = ChronoUnit.SECONDS.between(this.openingActivityEndTime.toInstant(), this.shopCreateTime.toInstant());
long between = ChronoUnit.SECONDS.between(this.shopCreateTime.toInstant(), this.openingActivityEndTime.toInstant());
double days = (double) between / (24*60*60);
this.days = String.format("%.1f", days);
}
}
}