Skip to content

Commit

Permalink
Merge pull request #726 from support-project/fix/issue724_report_survey
Browse files Browse the repository at this point in the history
Fix/issue724 report survey
  • Loading branch information
koda-masaru authored May 16, 2017
2 parents 3c15b08 + 175ef21 commit 80f8411
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
9 changes: 8 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,20 @@ gulp.task('min', function() {
.pipe(gulp.dest('target/knowledge/WEB-INF/views/'));
});

gulp.task('copy', ['copy:bootswatch', 'copy:highlightjs', 'copy:font-awesome', 'copy:flag-icon-css',
gulp.task('copy', ['copy:bootswatch', 'copy:bootswatch2', 'copy:highlightjs', 'copy:font-awesome', 'copy:flag-icon-css',
'copy:html5shiv', 'copy:respond', 'copy:MathJax', 'copy:emoji-parser', 'copy:free-file-icons',
'copy:diff2html', 'copy:jsdiff']);

gulp.task('copy:bootswatch', function() {
return gulp.src([
'src/main/webapp/bower/bootswatch/**/*'
])
.pipe(gulp.dest('target/knowledge/bower/bootswatch'));
});
gulp.task('copy:bootswatch2', function() {
return gulp.src([
'src/main/webapp/bower/bootswatch/**/*.css'
])
.pipe(replace(/^@import url\("https:\/\/fonts.googleapis.com\/css.*\)\;/, ''))
.pipe(gulp.dest('target/knowledge/bower/bootswatch'));
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.support.project.web.control.service.Get;
import org.support.project.web.control.service.Post;
import org.support.project.web.exception.InvalidParamException;
import org.support.project.web.logic.DateConvertLogic;

import net.arnx.jsonic.JSONException;

Expand Down Expand Up @@ -239,6 +240,10 @@ public Boundary report() throws InvalidParamException {
return sendError(HttpStatus.SC_403_FORBIDDEN, "FORBIDDEN");
}
SurveyReport report = SurveyLogic.get().loadAnswers(knowledgeId, getLoginUserId());
List<SurveyAnswersEntity> answers = report.getAnswers();
for (SurveyAnswersEntity ans : answers) {
ans.setLocalDatetime(DateConvertLogic.get().convertDate(ans.getInsertDatetime(), getRequest()));
}
return send(report);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class SurveyAnswersEntity extends GenSurveyAnswersEntity {

/** 回答者の名前 */
private String userName;
/** 回答集計を操作しているユーザのタイムゾーン/ロケールでの日付文字列 */
private String localDatetime;

/** SerialVersion */
private static final long serialVersionUID = 1L;
Expand Down Expand Up @@ -76,4 +78,18 @@ public void setUserName(String userName) {
this.userName = userName;
}

/**
* @return the localDatetime
*/
public String getLocalDatetime() {
return localDatetime;
}

/**
* @param localDatetime the localDatetime to set
*/
public void setLocalDatetime(String localDatetime) {
this.localDatetime = localDatetime;
}

}
3 changes: 2 additions & 1 deletion src/main/webapp/js/survey-answers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ $(document).ready(function() {

result.answers.forEach(function(answer) {
var row = {};
row.answer_datetime = moment(answer.insertDatetime, 'YYYY-MM-DD HH:mm:ss.SSS').format('YYYY-MM-DD HH:mm');
row.answer_datetime = answer.localDatetime;
// row.answer_datetime = moment(answer.insertDatetime, 'YYYY-MM-DD HH:mm:ss.SSS').format('YYYY-MM-DD HH:mm');
row.answer_user = answer.userName;

answer.items.forEach(function(answerItem) {
Expand Down

0 comments on commit 80f8411

Please sign in to comment.