Commit 8e8669af authored by yuanshuo's avatar yuanshuo

1.获取评审人员意见时 返回时间格式有所调整

parent 7dc7da66
......@@ -603,6 +603,13 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId();
List<ReviewOpinionResponse> list = reviewSceneChangeTaskMapper.getReviewerOpinion(id,userId);
// 遍历列表,设置格式化后的时间
for (ReviewOpinionResponse reviewOpinion : list) {
// 自动通过 getFormattedDecisionTime() 获取格式化时间
reviewOpinion.setFormattedDecisionTime(reviewOpinion.getFormattedDecisionTime());
}
return list;
}
......
......@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.text.SimpleDateFormat;
import java.util.Date;
@ApiModel(value = "ReviewOpinionResponse", description = "评审动态")
......@@ -22,4 +23,17 @@ public class ReviewOpinionResponse {
@ApiModelProperty("评审意见")
private String comment;
// 用于返回格式化后的日期字符串
@ApiModelProperty("格式化后的评审时间")
private String formattedDecisionTime;
// 设置格式化后的时间
public String getFormattedDecisionTime() {
if (this.decisionTime != null) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
return sdf.format(this.decisionTime);
}
return null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment