为符合项导出的excel 计划关闭时间去掉时分秒
This commit is contained in:
+9
-1
@@ -146,13 +146,21 @@ public class SarStandUnqualified extends BaseEntity {
|
||||
@TableField("DUTY_ENGINEER")
|
||||
private String dutyEngineer;
|
||||
|
||||
@ExcelProperty("计划关闭时间")
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "计划关闭时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@TableField("PLAN_CLOSE_TIME")
|
||||
private Date planCloseTime;
|
||||
|
||||
|
||||
@ExcelProperty("计划关闭时间")
|
||||
@ApiModelProperty(value = "计划关闭时间excel导出")
|
||||
|
||||
@TableField(exist = false)
|
||||
private String planCloseTimeExport;
|
||||
|
||||
|
||||
@ExcelIgnore
|
||||
@ApiModelProperty(value = "主键")
|
||||
@TableId(type = IdType.UUID)
|
||||
|
||||
+14
@@ -18,6 +18,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.sql.Timestamp;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -165,6 +167,18 @@ public class SarStandUnqualifiedServiceImpl extends ServiceImpl<SarStandUnqualif
|
||||
sarStandUnqualifiedQueryWrapper.in("id",standUnqualifiedExcelVO.getIds());
|
||||
}
|
||||
List<SarStandUnqualified> stand = sarStandUnqualifiedDao.selectList(sarStandUnqualifiedQueryWrapper);
|
||||
// 去掉日期时分秒
|
||||
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
stand.forEach(item->{
|
||||
|
||||
Optional.ofNullable(item.getPlanCloseTime())
|
||||
.ifPresent(time ->{
|
||||
item.setPlanCloseTimeExport(sdf.format(time));
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
List<SarStandUnqualified> a = stand;
|
||||
return a;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user