Commit fd86a15d authored by 王国存's avatar 王国存

Merge branch 'test' into 'master'

Test

See merge request !34
parents 61306bec 94c8ef59
...@@ -7,10 +7,12 @@ import com.tiptimes.service.FileService; ...@@ -7,10 +7,12 @@ import com.tiptimes.service.FileService;
import com.tiptimes.service.QuestionnaireService; import com.tiptimes.service.QuestionnaireService;
import com.tiptimes.util.*; import com.tiptimes.util.*;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.ObjectUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
...@@ -185,19 +187,26 @@ public class QuestionnaireCtrl { ...@@ -185,19 +187,26 @@ public class QuestionnaireCtrl {
map.put("msg", "不存在需要保存的备注"); map.put("msg", "不存在需要保存的备注");
return map; return map;
} }
int result;
//1.通过记录id删除原有备注 try {
this.questionnaireService.delView(review.get(0).getRecordId(),review.get(0).getQuestionsId()); questionnaireService.saveReview(review);
//2.添加新的备注 } catch (Exception e) {
result=this.questionnaireService.insertReview(review,review.get(0).getRecordId());
if(result>0) {
map.put("result", true);
map.put("msg", "操作成功");
} else {
map.put("result", false); map.put("result", false);
map.put("msg", "操作失败"); map.put("msg", "操作失败");
} }
map.put("result", true);
map.put("msg", "操作成功");
//1.通过记录id删除原有备注
//this.questionnaireService.delView(review.get(0).getRecordId(),review.get(0).getQuestionsId());
//2.添加新的备注
//result=this.questionnaireService.insertReview(review,review.get(0).getRecordId());
// if(result>0) {
// map.put("result", true);
// map.put("msg", "操作成功");
// } else {
// map.put("result", false);
// map.put("msg", "操作失败");
// }
return map; return map;
} }
......
...@@ -85,4 +85,10 @@ public interface QuestionnaireDao { ...@@ -85,4 +85,10 @@ public interface QuestionnaireDao {
List<Review> selectAnswerByStatus(@Param("recordId") Long recordId); List<Review> selectAnswerByStatus(@Param("recordId") Long recordId);
List<Integer> selectAnswerByQuestion(@Param("recordId") Long recordId); List<Integer> selectAnswerByQuestion(@Param("recordId") Long recordId);
Review selectOneReviewByRecordIdAndQuestionsId(@Param("recordId") Long recordId,@Param("questionsId") Long questionsId);
Integer updateOneReviewByRecordIdAndQuestionsId(@Param("review") Review review);
Integer insertOneReview(@Param("review") Review review);
} }
...@@ -8,7 +8,7 @@ public class Answer {//上报数据表(每条上报记录的详细数据表) ...@@ -8,7 +8,7 @@ public class Answer {//上报数据表(每条上报记录的详细数据表)
private int recordId;//上报记录id private int recordId;//上报记录id
private String remark;//备注 private String remark;//备注
private int score;//分数 private float score;//分数
public String getRemark() { public String getRemark() {
return remark; return remark;
...@@ -58,11 +58,11 @@ public class Answer {//上报数据表(每条上报记录的详细数据表) ...@@ -58,11 +58,11 @@ public class Answer {//上报数据表(每条上报记录的详细数据表)
this.recordId = recordId; this.recordId = recordId;
} }
public int getScore() { public float getScore() {
return score; return score;
} }
public void setScore(int score) { public void setScore(float score) {
this.score = score; this.score = score;
} }
......
...@@ -6,22 +6,22 @@ public class Review {//评审备注详情表 ...@@ -6,22 +6,22 @@ public class Review {//评审备注详情表
private Long recordId;//记录id private Long recordId;//记录id
private String remark;//驳回原因 private String remark;//驳回原因
private int score; //审批评分 private float score; //审批评分
private int approvalStatus;//审批状态,0-驳回,1-通过 private Integer approvalStatus;//审批状态,0-驳回,1-通过
public int getScore() { public float getScore() {
return score; return score;
} }
public void setScore(int score) { public void setScore(float score) {
this.score = score; this.score = score;
} }
public int getApprovalStatus() { public Integer getApprovalStatus() {
return approvalStatus; return approvalStatus;
} }
public void setApprovalStatus(int approvalStatus) { public void setApprovalStatus(Integer approvalStatus) {
this.approvalStatus = approvalStatus; this.approvalStatus = approvalStatus;
} }
......
...@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Param; ...@@ -11,6 +11,7 @@ import org.apache.ibatis.annotations.Param;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
import java.util.Map;
public interface QuestionnaireService { public interface QuestionnaireService {
/** /**
...@@ -104,6 +105,14 @@ public interface QuestionnaireService { ...@@ -104,6 +105,14 @@ public interface QuestionnaireService {
void exportPerformanceSummary(HttpServletRequest request, HttpServletResponse response); void exportPerformanceSummary(HttpServletRequest request, HttpServletResponse response);
Integer updateAnswerScore(Answer answer); Integer updateAnswerScore(Answer answer);
Review selectOneReviewByRecordIdAndQuestionsId( Long recordId, Long questionsId);
Integer updateOneReviewByRecordIdAndQuestionsId(Review review);
Integer insertOneReview(Review review);
Integer saveReview(List<Review> reviews) throws Exception;
} }
...@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -28,6 +28,7 @@ import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Map;
@Service @Service
...@@ -805,27 +806,27 @@ public class QuestionnaireServiceImpl implements QuestionnaireService { ...@@ -805,27 +806,27 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
summaryList.get(i).setIndex(i+1); summaryList.get(i).setIndex(i+1);
//计算引导指标和奖励指标分数 //计算引导指标和奖励指标分数
Integer guideIndexScore = summaryList.get(i).getGuideIndexOne() + summaryList.get(i).getGuideIndexTwo() + summaryList.get(i).getGuideIndexThree() float guideIndexScore = summaryList.get(i).getGuideIndexOne() + summaryList.get(i).getGuideIndexTwo() + summaryList.get(i).getGuideIndexThree()
+ summaryList.get(i).getGuideIndexFour() + summaryList.get(i).getGuideIndexFive() + summaryList.get(i).getGuideIndexSix() + summaryList.get(i).getGuideIndexSeven() + summaryList.get(i).getGuideIndexFour() + summaryList.get(i).getGuideIndexFive() + summaryList.get(i).getGuideIndexSix() + summaryList.get(i).getGuideIndexSeven()
+ summaryList.get(i).getGuideIndexEight() + summaryList.get(i).getGuideIndexNine() + summaryList.get(i).getGuideIndexTen() + summaryList.get(i).getGuideIndexEleven() + summaryList.get(i).getGuideIndexEight() + summaryList.get(i).getGuideIndexNine() + summaryList.get(i).getGuideIndexTen() + summaryList.get(i).getGuideIndexEleven()
+ summaryList.get(i).getGuideIndexTwelve() + summaryList.get(i).getGuideIndexThirteen(); + summaryList.get(i).getGuideIndexTwelve() + summaryList.get(i).getGuideIndexThirteen();
if(guideIndexScore >= 50){ if(guideIndexScore >= 50.0){
summaryList.get(i).setGuideIndexScore(50); summaryList.get(i).setGuideIndexScore(50);
}else{ }else{
summaryList.get(i).setGuideIndexScore(guideIndexScore); summaryList.get(i).setGuideIndexScore(guideIndexScore);
} }
//计算奖励指标分数 //计算奖励指标分数
Integer rewardIndexScore = summaryList.get(i).getRewardIndexOne() + summaryList.get(i).getRewardIndexTwo() + summaryList.get(i).getRewardIndexThree() float rewardIndexScore = summaryList.get(i).getRewardIndexOne() + summaryList.get(i).getRewardIndexTwo() + summaryList.get(i).getRewardIndexThree()
+ summaryList.get(i).getRewardIndexFour() + summaryList.get(i).getRewardIndexFive(); + summaryList.get(i).getRewardIndexFour() + summaryList.get(i).getRewardIndexFive();
if(rewardIndexScore >= 10){ if(rewardIndexScore >= 10.0){
summaryList.get(i).setRewardIndexScore(10); summaryList.get(i).setRewardIndexScore(10);
}else{ }else{
summaryList.get(i).setRewardIndexScore(rewardIndexScore); summaryList.get(i).setRewardIndexScore(rewardIndexScore);
} }
//总分数 //总分数
Integer totalScore = summaryList.get(i).getBasisIndexScore() + summaryList.get(i).getGuideIndexScore() + summaryList.get(i).getRewardIndexScore(); float totalScore = summaryList.get(i).getBasisIndexScore() + summaryList.get(i).getGuideIndexScore() + summaryList.get(i).getRewardIndexScore();
summaryList.get(i).setTotalScore(totalScore); summaryList.get(i).setTotalScore(totalScore);
} }
//生成excel //生成excel
...@@ -844,4 +845,41 @@ public class QuestionnaireServiceImpl implements QuestionnaireService { ...@@ -844,4 +845,41 @@ public class QuestionnaireServiceImpl implements QuestionnaireService {
public Integer updateAnswerScore(Answer answer){ public Integer updateAnswerScore(Answer answer){
return questionnaireDao.updateAnswerScore(answer); return questionnaireDao.updateAnswerScore(answer);
} }
@Override
public Review selectOneReviewByRecordIdAndQuestionsId(Long recordId, Long questionsId) {
return questionnaireDao.selectOneReviewByRecordIdAndQuestionsId(recordId,questionsId);
}
@Override
public Integer updateOneReviewByRecordIdAndQuestionsId(Review review) {
return questionnaireDao.updateOneReviewByRecordIdAndQuestionsId(review);
}
@Override
public Integer insertOneReview(Review review) {
return questionnaireDao.insertOneReview(review);
}
@Override
@Transactional(rollbackFor = Exception.class)
public Integer saveReview(List<Review> reviews) throws Exception {
//结果
Integer result=0;
//遍历存在则更新,不存在则新增
for (Review reviewItem: reviews) {
if(questionnaireDao.selectOneReviewByRecordIdAndQuestionsId(reviewItem.getRecordId(),reviewItem.getQuestionsId())==null){
//新增
result+=questionnaireDao.insertOneReview(reviewItem);
}else {
//更新
result+= questionnaireDao.updateOneReviewByRecordIdAndQuestionsId(reviewItem);
}
}
if(reviews.size()==result){
return result;
}else {
throw new Exception();
}
}
} }
...@@ -604,4 +604,21 @@ ...@@ -604,4 +604,21 @@
and questions_id BETWEEN 1 AND 27 and questions_id BETWEEN 1 AND 27
ORDER BY questions_id asc ORDER BY questions_id asc
</select> </select>
<select id="selectOneReviewByRecordIdAndQuestionsId" resultType="com.tiptimes.model.Review">
select id,questions_id,record_id,remark,approval_status,score
from t_review
where questions_id=#{questionsId} and record_id=#{recordId}
</select>
<update id="updateOneReviewByRecordIdAndQuestionsId" parameterType="com.tiptimes.model.Review" >
update t_review
set remark=#{review.remark}
where questions_id=#{review.questionsId} and record_id=#{review.recordId}
</update>
<insert id="insertOneReview" parameterType="com.tiptimes.model.Review" >
insert into t_review(questions_id,record_id,remark)
values (#{review.questionsId},#{review.recordId},#{review.remark})
</insert>
</mapper> </mapper>
\ No newline at end of file
...@@ -20,6 +20,18 @@ ...@@ -20,6 +20,18 @@
<link href="<%=request.getContextPath()%>/res/css/style.css?v=4.1.0" rel="stylesheet"> <link href="<%=request.getContextPath()%>/res/css/style.css?v=4.1.0" rel="stylesheet">
<link href="<%=request.getContextPath()%>/res/js/plugins/highlight/highlight.css" rel="stylesheet"> <link href="<%=request.getContextPath()%>/res/js/plugins/highlight/highlight.css" rel="stylesheet">
<style type="text/css">
.shadowlight{
border-top: 9px solid #00ff00;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
}
.shadow{
border-top: 9px solid black;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
}
</style>
</head> </head>
<body> <body>
<script type="text/javascript"> <script type="text/javascript">
...@@ -56,17 +68,16 @@ ...@@ -56,17 +68,16 @@
<td>引导指标得分</td> <td>引导指标得分</td>
<td>奖励指标得分</td> <td>奖励指标得分</td>
<td> <td>
<div style="text-align: left;"> <div style="display: flex;align-items: center;justify-content: center;height: 30px;">
<div style="display: inline-block;padding-bottom: 22px;margin-right: 10px"> <div style="display: inline-block;margin-right: 10px">
合计得分 合计得分
</div> </div>
<div style="display: inline-block;padding-top: 18px"> <div >
<div onclick="sortAsc()" <%-- <div onclick="sortAsc()"--%>
style=" width: 0px;height: 0px; border-bottom: 9px solid black;border-left: 10px solid transparent; border-right: 10px solid transparent;"> <%-- style=" border-bottom: 9px solid black;border-left: 10px solid transparent; border-right: 10px solid transparent;">--%>
</div> <%-- </div>--%>
<div style="height: 18px"></div> <%-- <div style="height: 14px"></div>--%>
<div onclick="sortDesc()" <div id="boxShadow" class="shadow" onclick="sortDesc()">
style=" width: 0px;height: 0px; border-top: 9px solid black;border-left: 10px solid transparent; border-right: 10px solid transparent;">
</div> </div>
</div> </div>
</div> </div>
......
...@@ -279,9 +279,9 @@ ...@@ -279,9 +279,9 @@
</div> </div>
<div class="form-group" id="submit2"> <div class="form-group" id="submit2">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_2" cols="30" rows="3"></textarea> <textarea name="question_2" cols="30" rows="3"></textarea>
...@@ -368,9 +368,9 @@ ...@@ -368,9 +368,9 @@
</div> </div>
<div class="form-group" id="submit3"> <div class="form-group" id="submit3">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_3" cols="30" rows="3"></textarea> <textarea name="question_3" cols="30" rows="3"></textarea>
...@@ -468,9 +468,9 @@ ...@@ -468,9 +468,9 @@
</div> </div>
<div class="form-group" id="submit4"> <div class="form-group" id="submit4">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_4" cols="30" rows="3"></textarea> <textarea name="question_4" cols="30" rows="3"></textarea>
...@@ -613,9 +613,9 @@ ...@@ -613,9 +613,9 @@
</div> </div>
<div class="form-group" id="submit5"> <div class="form-group" id="submit5">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_5" cols="30" rows="3"></textarea> <textarea name="question_5" cols="30" rows="3"></textarea>
...@@ -816,9 +816,9 @@ ...@@ -816,9 +816,9 @@
</div> </div>
<div class="form-group" id="submit6"> <div class="form-group" id="submit6">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_6" cols="30" rows="3"></textarea> <textarea name="question_6" cols="30" rows="3"></textarea>
...@@ -910,9 +910,9 @@ ...@@ -910,9 +910,9 @@
</div> </div>
<div class="form-group" id="submit7"> <div class="form-group" id="submit7">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_7" cols="30" rows="3"></textarea> <textarea name="question_7" cols="30" rows="3"></textarea>
...@@ -984,9 +984,9 @@ ...@@ -984,9 +984,9 @@
</div> </div>
<div class="form-group" id="submit8"> <div class="form-group" id="submit8">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_8" cols="30" rows="3"></textarea> <textarea name="question_8" cols="30" rows="3"></textarea>
...@@ -1031,9 +1031,9 @@ ...@@ -1031,9 +1031,9 @@
</div> </div>
<div class="form-group" id="submit9"> <div class="form-group" id="submit9">
<p> <p>
<input id="list" onclick="acheck1()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="1">驳回 name="list" value="1">驳回
<input id="list" onclick="acheck2()" type="radio" <input id="list" onclick="" type="radio"
name="list" value="2">通过 name="list" value="2">通过
</p> </p>
<textarea name="question_9" cols="30" rows="3"></textarea> <textarea name="question_9" cols="30" rows="3"></textarea>
......
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
<ul class="nav nav-second-level"> <ul class="nav nav-second-level">
<li><a class="J_menuItem" <li><a class="J_menuItem"
href="<%=request.getContextPath()%>/goto/space/questionnaire_information" href="<%=request.getContextPath()%>/goto/space/questionnaire_information"
>2021年天津市高校众创空间绩效评估</a></li> >2022年天津市高校众创空间绩效评估</a></li>
</ul> </ul>
</li> </li>
<%-- <li><a class="J_menuItem" href="<%=request.getContextPath()%>/goto/space/space_change_password" data-index="0"> <i class="fa fa-rotate-left"></i> <span class="nav-label">修改密码</span></a></li> <%-- <li><a class="J_menuItem" href="<%=request.getContextPath()%>/goto/space/space_change_password" data-index="0"> <i class="fa fa-rotate-left"></i> <span class="nav-label">修改密码</span></a></li>
......
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<div class="col-sm-12"> <div class="col-sm-12">
<div class="ibox float-e-margins"> <div class="ibox float-e-margins">
<div class="ibox-title"> <div class="ibox-title">
<h5 style="margin-left: 20px; font-size: 20px;text-align: center">2021年度天津市高校众创空间绩效评估</h5> <h5 style="margin-left: 20px; font-size: 20px;text-align: center">2022年度天津市高校众创空间绩效评估</h5>
</div> </div>
<div class="ibox-content"> <div class="ibox-content">
<form method="get" class="form-horizontal"> <form method="get" class="form-horizontal">
......
...@@ -4,38 +4,46 @@ $(function () { ...@@ -4,38 +4,46 @@ $(function () {
//降序排列 //降序排列
function sortDesc() { function sortDesc() {
var sorting='desc' if ($("#boxShadow").hasClass('shadowlight')) {
if ($("#title").val().length > 50) { $("#boxShadow").removeAttr('class')
swal("失败!",'输入字符过多!', "error") $("#boxShadow").attr('class','shadow')
} else { getTableData()
$.ajax({ }else {
url: webroot + "questionnaire/selectPerformanceSummaryList", $("#boxShadow").removeAttr('class')
method: "GET", $("#boxShadow").attr('class','shadowlight')
datatype: "json", var sorting='desc'
data: { if ($("#title").val().length > 50) {
"optinName": $("#title").val(), swal("失败!",'输入字符过多!', "error")
"sorting":sorting } else {
}, $.ajax({
success: (res) => { url: webroot + "questionnaire/selectPerformanceSummaryList",
$("tbody").empty() method: "GET",
for (let i = 0; i < res.data.performanceSummaryList.length; i++) { datatype: "json",
$("tbody").append( data: {
"<tr>" + "optinName": $("#title").val(),
"<td>" + (i + 1) + "</td>" + "sorting":sorting
"<td>" + res.data.performanceSummaryList[i].optinName + "</td>" + },
"<td>" + res.data.performanceSummaryList[i].basicIndicators + "</td>" + success: (res) => {
"<td>" + res.data.performanceSummaryList[i].guideIndicators + "</td>" + $("tbody").empty()
"<td>" + res.data.performanceSummaryList[i].rewardIndicators + "</td>" + for (let i = 0; i < res.data.performanceSummaryList.length; i++) {
"<td>" + res.data.performanceSummaryList[i].totalScore + "</td>" + $("tbody").append(
"</tr>" "<tr>" +
) "<td>" + (i + 1) + "</td>" +
} "<td>" + res.data.performanceSummaryList[i].optinName + "</td>" +
"<td>" + res.data.performanceSummaryList[i].basicIndicators + "</td>" +
"<td>" + res.data.performanceSummaryList[i].guideIndicators + "</td>" +
"<td>" + res.data.performanceSummaryList[i].rewardIndicators + "</td>" +
"<td>" + res.data.performanceSummaryList[i].totalScore + "</td>" +
"</tr>"
)
}
}, },
error: () => { error: () => {
swal("失败!",'网络有问题,稍后再试', "error") swal("失败!",'网络有问题,稍后再试', "error")
} }
}) })
}
} }
} }
......
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