Browse Source

增加指标最大最小分数字段;
修改对标分析数据接口

chenminghua 1 year ago
parent
commit
0c7ae445cd

+ 4 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluateRuleInfo.java

@@ -84,11 +84,13 @@ public class EvaluateRuleInfo extends Model {
 	 */
 	private Integer orderNum;
 
-	private Double minScore;
+	private Double profitMinScore;
 
-	private Double maxScore;
+	private Double profitMaxScore;
 
 	private Double standardScore;
 
+	private Double lossMinScore;
 
+	private Double lossMaxScore;
 }

+ 3 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluatioinScoreCountServiceImpl.java

@@ -65,9 +65,10 @@ public class EvaluatioinScoreCountServiceImpl extends ServiceImpl<EvaluationScor
 			Map<String, Object> mp = new HashMap<>();
 			for (int i = 0; i < v.size(); i++) {
 				Map<String, Object> item = v.get(i);
-				mp.put(item.get("indicator_code").toString() + "_score", item.get("score"));
+				mp.put(item.get("indicator_code").toString(), item.get("score"));
 				mp.put("organization_name", item.get("organization_name"));
-				mp.put("flag", item.get("score") == item.get("standard_score") ? "0" : (int) item.get("score") > (int)item.get("standard_score") ? "1" : "-1");
+				mp.put(item.get("indicator_code").toString() + "_flag", item.get("score") == item.get("standard_score") ? "0"
+					: Double.valueOf(item.get("score").toString()) > Double.valueOf(item.get("standard_score").toString()) ? "1" : "-1");
 
 				if (flag) {
 					Map<String, Object> tl = new HashMap<>();

+ 3 - 0
ims-service/ims-eval/src/main/resources/application.yml

@@ -3,6 +3,9 @@ mybatis-plus:
   mapper-locations: classpath:mappers/*.xml
   #实体扫描,多个package用逗号或者分号分隔
   typeAliasesPackage: com.ims.eval.entity,com.ims.**.entity
+  configuration:
+    #设置当查询结果值为null时,同样映射该查询字段给map。
+    call-setters-on-nulls: true
 
 #swagger扫描路径配置
 swagger:

+ 5 - 3
ims-service/ims-eval/src/main/resources/mappers/EvaluateRuleInfoMapper.xml

@@ -13,14 +13,16 @@
         <result column="update_time" property="updateTime" />
         <result column="update_by" property="updateBy" />
         <result column="order_num" property="orderNum" />
-        <result column="min_score" property="minScore" />
-        <result column="max_score" property="maxScore" />
+        <result column="min_score" property="profitMinScore" />
+        <result column="max_score" property="profitMaxScore" />
         <result column="standard_score" property="standardScore" />
+        <result column="loss_min_score" property="lossMinScore" />
+        <result column="loss_max_score" property="lossMaxScore" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id, evaluate_rule_id, indicator_id, des, create_time, create_by, update_time, update_by, order_num, min_score, max_score, standard_score
+        id, evaluate_rule_id, indicator_id, des, create_time, create_by, update_time, update_by, order_num, min_score, max_score, standard_score, loss_min_score, loss_max_score
     </sql>
 
     <select id="selectListAll" resultType="com.ims.eval.entity.EvaluateRuleInfo">

+ 3 - 2
ims-service/ims-eval/src/main/resources/mappers/EvaluationScoreCountMapper.xml

@@ -41,16 +41,17 @@
 
     <select id="selectEvaluationList" resultType="java.util.Map">
         SELECT
+        distinct(es.id),
         oer.organization_name,
         es.score,
-        es.obversion_score,
         i.indicator_name,
+        i.indicator_code,
         i.unit,
         ei.standard_score
         FROM
         evaluation_score_count es
         LEFT JOIN indicator i ON es.indicator_id = i.id
-        LEFT JOIN evaluate_rule_info ei ON es.indicator_id = i.id
+        LEFT JOIN evaluate_rule_info ei ON ei.indicator_id = es.indicator_id
         LEFT JOIN indicator_type t ON i.indicator_type_id = t.id
         LEFT JOIN bin_stage b ON i.bin_stage = b.id
         LEFT JOIN bin_section bs ON i.bin_section = bs.id