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