Commit 1cc9c9ed authored by 宋源硕's avatar 宋源硕

Merge branch 'songyuanshuo' into 'master'

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

See merge request !16
parents 7dc7da66 8e8669af
...@@ -603,6 +603,13 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha ...@@ -603,6 +603,13 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
LoginUser loginUser = SecurityUtils.getLoginUser(); LoginUser loginUser = SecurityUtils.getLoginUser();
Long userId = loginUser.getUserId(); Long userId = loginUser.getUserId();
List<ReviewOpinionResponse> list = reviewSceneChangeTaskMapper.getReviewerOpinion(id,userId); List<ReviewOpinionResponse> list = reviewSceneChangeTaskMapper.getReviewerOpinion(id,userId);
// 遍历列表,设置格式化后的时间
for (ReviewOpinionResponse reviewOpinion : list) {
// 自动通过 getFormattedDecisionTime() 获取格式化时间
reviewOpinion.setFormattedDecisionTime(reviewOpinion.getFormattedDecisionTime());
}
return list; return list;
} }
......
...@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel; ...@@ -4,6 +4,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
@ApiModel(value = "ReviewOpinionResponse", description = "评审动态") @ApiModel(value = "ReviewOpinionResponse", description = "评审动态")
...@@ -22,4 +23,17 @@ public class ReviewOpinionResponse { ...@@ -22,4 +23,17 @@ public class ReviewOpinionResponse {
@ApiModelProperty("评审意见") @ApiModelProperty("评审意见")
private String comment; 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