diff --git a/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/OutsourcerEvaluateController.java b/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/OutsourcerEvaluateController.java index 98a5808..8db7fd9 100644 --- a/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/OutsourcerEvaluateController.java +++ b/src/main/java/com/bonus/gs/sub/evaluate/evaluate/controller/OutsourcerEvaluateController.java @@ -18,10 +18,7 @@ import org.apache.commons.lang3.time.DateUtils; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -406,8 +403,8 @@ public class OutsourcerEvaluateController extends BaseController 0){ + Integer num = outsourcerEvaluateDao.selectScore(o); + if (num > 0) { ar.setFailMsg("部门评价未完成,请先评价"); return ar; } @@ -678,7 +675,7 @@ public class OutsourcerEvaluateController extends BaseController getAuditBtn(EvaluateDataBean o); - AjaxRes updateJsonData(EvaluateDataBean o); + Integer updateJsonData(EvaluateDataBean o); EvaluateDataBean getSummaryJsonData(EvaluateSubBean o); @@ -148,7 +148,7 @@ public interface OutsourcerEvaluateDao { /** * 重新 - * @param o + * @param */ void updateEvalStatus(@Param("status") String status,@Param("id")String id); diff --git a/src/main/resources/static/pages/evaluate/evaluationSummary/evaluateSummaryForm.html b/src/main/resources/static/pages/evaluate/evaluationSummary/evaluateSummaryForm.html index 6fad73e..398b387 100644 --- a/src/main/resources/static/pages/evaluate/evaluationSummary/evaluateSummaryForm.html +++ b/src/main/resources/static/pages/evaluate/evaluationSummary/evaluateSummaryForm.html @@ -441,19 +441,26 @@ Object.keys(map).forEach((key) => { if (key.split('-').length === 3) { if (key.startsWith(item)) { - subArr.push(parseInt(isEmpty(map[key]) ? '0' : map[key])); + subArr.push(parseFloat(isEmpty(map[key]) ? '0' : map[key])); } } }); //计算小计 + // if (twoLevelCountType === '最高分') { + // subTotals = Math.max(...subArr); + // } else if (twoLevelCountType === '平均分') { + // subTotals = (subArr.reduce((prev, curr) => { + // return prev + curr; + // }, 0) / subArr.length).toFixed(2); + // } else if (twoLevelCountType === '最低分') { + // subTotals = Math.min(...subArr); + // } if (twoLevelCountType === '最高分') { - subTotals = Math.max(...subArr); + subTotals = Math.max(...subArr).toFixed(2); } else if (twoLevelCountType === '平均分') { - subTotals = (subArr.reduce((prev, curr) => { - return prev + curr; - }, 0) / subArr.length).toFixed(2); + subTotals = (subArr.reduce((a, b) => a + b, 0) / subArr.length).toFixed(2); } else if (twoLevelCountType === '最低分') { - subTotals = Math.min(...subArr); + subTotals = Math.min(...subArr).toFixed(2); } itemData[item + '-subtotal'] = subTotals; subTotals = 0; diff --git a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html index ebaff0a..07f7718 100644 --- a/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html +++ b/src/main/resources/static/pages/evaluate/outsourcerEvaluation/evaluationForm.html @@ -5,7 +5,7 @@ Demo - +