1
0

3 Commits dcc1493336 ... a2cdb5377a

Autor SHA1 Nachricht Datum
  全业务考评 a2cdb5377a 冲突处理 vor 8 Monaten
  全业务考评 cee776aeff Merge remote-tracking branch 'origin/master' vor 8 Monaten
  全业务考评 ca952b6b7c 考评规则优化 vor 8 Monaten

+ 2 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluateRuleInfoController.java

@@ -84,7 +84,8 @@ public class EvaluateRuleInfoController {
 	@ApiOperation(value = "删除", notes = "删除")
 	public R deleteAll(@PathVariable("ids") String ids) {
 		String[] strings = ids.split(",");
-		boolean b = evaluateRuleInfoService.removeByIds(Arrays.asList(strings));
+//		boolean b = evaluateRuleInfoService.removeByIds(Arrays.asList(strings));
+		boolean b = evaluateRuleInfoService.updateDeleteTime(Arrays.asList(strings));
 		if (b) {
 			return R.ok().data(b);
 		} else {

+ 7 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/EvaluateRuleInfo.java

@@ -1,5 +1,6 @@
 package com.ims.eval.entity;
 
+import com.baomidou.mybatisplus.annotation.FieldStrategy;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import java.util.Date;
@@ -89,4 +90,10 @@ public class EvaluateRuleInfo extends Model {
 	private Double maxScore;
 
 	private Double standardScore;
+
+	/**
+	 * 删除时间
+	 */
+	@TableField(updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
+	private Date deleteTime;
 }

+ 3 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/IEvaluateRuleInfoService.java

@@ -24,5 +24,7 @@ public interface IEvaluateRuleInfoService extends IService<EvaluateRuleInfo> {
 
 	List<EvaluateRuleInfoIndicatorDTO> listByIndicatorInfo(List<String> ruleInfoIds);
 
-    List<EvaluateRuleInfo> getEvaluateRuleInfoByEvaluateRuleId(String evaluateRuleId);
+	List<EvaluateRuleInfo> getEvaluateRuleInfoByEvaluateRuleId(String evaluateRuleId);
+
+	boolean updateDeleteTime(List<String> ids);
 }

+ 35 - 1
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/EvaluateRuleInfoServiceImpl.java

@@ -56,6 +56,25 @@ public class EvaluateRuleInfoServiceImpl extends ServiceImpl<EvaluateRuleInfoMap
 
 
 	@Override
+	public boolean updateDeleteTime(List<String> ids) {
+		int i = 0;
+		for (String id : ids) {
+			EvaluateRuleInfo info = baseMapper.selectById(id);
+			if (null != info) {
+				info.setDeleteTime(new Date());
+				i = baseMapper.updateById(info);
+
+				if (i == 0) {
+					return false;
+				}
+			}
+		}
+
+		return true;
+	}
+
+
+	@Override
 	public boolean saveOrUpdate(EvaluateRuleInfo entity) {
 
 		if (null != entity && (null == entity.getId() || "".equals(entity.getId().trim()))) {
@@ -63,8 +82,23 @@ public class EvaluateRuleInfoServiceImpl extends ServiceImpl<EvaluateRuleInfoMap
 			qw.lambda().eq(EvaluateRuleInfo::getEvaluateRuleId, entity.getEvaluateRuleId());
 			qw.lambda().eq(EvaluateRuleInfo::getIndicatorId, entity.getIndicatorId());
 			List<EvaluateRuleInfo> list = baseMapper.selectList(qw);
+
 			if (null != list && list.size() > 0) {
-				throw new CustomException("该指标已存在");
+				for(EvaluateRuleInfo upinfo:list){
+					if(null != upinfo.getDeleteTime()){
+						upinfo.setDeleteTime(null);
+						int i =  baseMapper.updateById(upinfo);
+						if(i<=0){
+							return false;
+						}else {
+							return true;
+						}
+					}else {
+						throw new CustomException("该指标已存在");
+					}
+
+
+				}
 			}
 			entity.setCreateTime(new Date());
 		} else {

+ 3 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/IndicatorServiceImpl.java

@@ -105,6 +105,9 @@ public class IndicatorServiceImpl extends ServiceImpl<IndicatorMapper, Indicator
 
 	@Override
 	public List<Indicator> listAll(String id, String indicatorName, String indicatorCode, String binSection, String binStage, String dept, String company,String evaluationCycle) {
+
+
+		evaluationCycle = evaluationCycle.replaceAll("ALL","");
 		List<Indicator> list = baseMapper.seleclistAll(id, indicatorName, indicatorCode, binSection, binStage, dept, company,evaluationCycle);
 		return list;
 	}

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

@@ -34,6 +34,7 @@
         LEFT JOIN evaluate_rule r ON ri.evaluate_rule_id = r.ID
         LEFT JOIN indicator i on ri.indicator_id = i.id
         <where>
+            and  delete_time is  null
             <if test="id !=null and id !=''">
                 AND ri.id = #{id}
             </if>
@@ -54,6 +55,7 @@
             </if>
 
 
+
         </where>
 
         order by ri.order_num asc
@@ -75,6 +77,7 @@
         LEFT JOIN INDICATOR i on i.id = ri.indicator_id
         LEFT JOIN indicator_dictionary d ON i.ID = d.indicator_id
         <where>
+            AND ri.delete_time is null
             AND ri.id in
             <foreach item="item" collection="ruleInfoIds" separator="," open="(" close=")" index="">'${item}'</foreach>
         </where>

+ 72 - 79
ims-service/ims-eval/src/main/resources/mappers/OrganizationEvaluationInfoMapper.xml

@@ -4,41 +4,40 @@
 
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.ims.eval.entity.OrganizationEvaluationInfo">
-        <id column="id" property="id"/>
-        <result column="organization_evaluation_id" property="organizationEvaluationId"/>
-        <result column="indicator_id" property="indicatorId"/>
-        <result column="indicator_dictionary_id" property="indicatorDictionaryId"/>
-        <result column="option_code" property="optionCode"/>
-        <result column="is_quantified" property="isQuantified"/>
-        <result column="quantified_value" property="quantifiedValue"/>
-        <result column="non_quantified_value" property="nonQuantifiedValue"/>
-        <result column="create_time" property="createTime"/>
-        <result column="create_by" property="createBy"/>
-        <result column="update_time" property="updateTime"/>
-        <result column="update_by" property="updateBy"/>
-        <result column="remark" property="remark"/>
+        <id column="id" property="id" />
+        <result column="organization_evaluation_id" property="organizationEvaluationId" />
+        <result column="indicator_id" property="indicatorId" />
+        <result column="indicator_dictionary_id" property="indicatorDictionaryId" />
+        <result column="option_code" property="optionCode" />
+        <result column="is_quantified" property="isQuantified" />
+        <result column="quantified_value" property="quantifiedValue" />
+        <result column="non_quantified_value" property="nonQuantifiedValue" />
+        <result column="create_time" property="createTime" />
+        <result column="create_by" property="createBy" />
+        <result column="update_time" property="updateTime" />
+        <result column="update_by" property="updateBy" />
+        <result column="remark" property="remark" />
     </resultMap>
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        id
-        , organization_evaluation_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark
+        id, organization_evaluation_id, indicator_id, indicator_dictionary_id, option_code, is_quantified, quantified_value, non_quantified_value, create_time, create_by, update_time, update_by, remark
     </sql>
 
 
-    <!--    <update id="updateEvaluationInfo">-->
+<!--    <update id="updateEvaluationInfo">-->
 
-    <!--            <foreach collection="evaluationInfos" item="item" index="index" separator=";">-->
-    <!--                <trim suffixOverrides=",">-->
-    <!--                    UPDATE organization_evaluation_info-->
-    <!--                    SET quantified_Value = ${item.quantifiedValue},-->
-    <!--                    non_Quantified_Value = '${item.nonQuantifiedValue}'-->
-    <!--                    WHERE id = '${item.id}'-->
-    <!--                </trim>-->
-    <!--            </foreach>-->
+<!--            <foreach collection="evaluationInfos" item="item" index="index" separator=";">-->
+<!--                <trim suffixOverrides=",">-->
+<!--                    UPDATE organization_evaluation_info-->
+<!--                    SET quantified_Value = ${item.quantifiedValue},-->
+<!--                    non_Quantified_Value = '${item.nonQuantifiedValue}'-->
+<!--                    WHERE id = '${item.id}'-->
+<!--                </trim>-->
+<!--            </foreach>-->
 
 
-    <!--    </update>-->
+<!--    </update>-->
 
     <select id="selectListEvaluationInfoId"
             resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
@@ -70,7 +69,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -79,7 +78,7 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and ei.organization_evaluation_id = #{organizationEvaluationId}
+                and  ei.organization_evaluation_id  = #{organizationEvaluationId}
             </if>
 
             <if test="optionCode !=null and optionCode !=''">
@@ -87,20 +86,17 @@
             </if>
 
             <if test="dept !=null and dept !=''">
-                and dd.key_name = #{dept}
+                and  dd.key_name = #{dept}
             </if>
 
             <if test="organizationId !=null and organizationId !=''">
-                and oer.organization_id = #{organizationId}
+                and  oer.organization_id = #{organizationId}
             </if>
 
-            and id.option_code not in
-            ('CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
+            and id.option_code not in ('CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
         </where>
 
-        order by
-        be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.child_code,id.option_code,id.option_order
-        asc
+        order by be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.child_code,id.option_code,id.option_order asc
 
     </select>
 
@@ -160,7 +156,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -169,7 +165,7 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and ei.organization_evaluation_id = #{organizationEvaluationId}
+                and  ei.organization_evaluation_id  = #{organizationEvaluationId}
             </if>
 
             <if test="optionCode !=null and optionCode !=''">
@@ -177,41 +173,37 @@
             </if>
 
             <if test="dept !=null and dept !=''">
-                and dd.key_name like CONCAT('%',#{dept},'%')
+                and  dd.key_name  like   CONCAT('%',#{dept},'%')
             </if>
 
             <if test="organizationShortName !=null and organizationShortName !=''">
-                and oer.organization_short_name like CONCAT('%',#{organizationShortName},'%')
+                and oer.organization_short_name  like   CONCAT('%',#{organizationShortName},'%')
             </if>
 
             <if test="indicatorName !=null and indicatorName !=''">
-                and i.indicator_name like CONCAT('%',#{indicatorName},'%')
+                and  i.indicator_name  like   CONCAT('%',#{indicatorName},'%')
             </if>
 
             <if test="binSection !=null and binSection !=''">
-                and bn.id = #{binSection}
+                and  bn.id = #{binSection}
             </if>
 
             <if test="isQuantified !=null and isQuantified !=''">
-                and ei.is_quantified = #{isQuantified}
+                and  ei.is_quantified = #{isQuantified}
             </if>
 
             <if test="organizationId !=null and organizationId !=''">
-                and oer.organization_id = #{organizationId}
+                and  oer.organization_id = #{organizationId}
             </if>
 
-            and id.option_code not in
-            ('DF','DF2','CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
+            and id.option_code not in ('DF','DF2','CZ','CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','WCLDF','LRGXKHMAX','LRGXKHMIN')
             and id.is_show = true
         </where>
 
-        order by
-        oer.organization_short_name,be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.option_order
-        asc
+        order by oer.organization_short_name,be.order_num,oer.organization_short_name,bn.order_num,ri.order_num,id.option_order asc
 
     </select>
-    <select id="selectByIdAndEvaluationInfoId"
-            resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
+    <select id="selectByIdAndEvaluationInfoId" resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
 
         select
         ei.id,
@@ -243,7 +235,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -251,21 +243,21 @@
         inner join data_dictionary dd on dd.data_key = i.dept_id
         <where>
 
-            <if test="id !=null and id !=''">
-                and ei.id = #{id}
-            </if>
+        <if test="id !=null and id !=''">
+            and  ei.id  = #{id}
+        </if>
 
-            <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and ei.organization_evaluation_id = #{organizationEvaluationId}
-            </if>
+        <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
+            and  ei.organization_evaluation_id  = #{organizationEvaluationId}
+        </if>
 
-            <if test="optionCode !=null and optionCode !=''">
-                and id.option_code = #{optionCode}
-            </if>
+        <if test="optionCode !=null and optionCode !=''">
+            and  id.option_code = #{optionCode}
+        </if>
 
-            <if test="indicatorId !=null and indicatorId !=''">
-                and i.id = #{indicatorId}
-            </if>
+        <if test="indicatorId !=null and indicatorId !=''">
+            and  i.id = #{indicatorId}
+        </if>
 
 
         </where>
@@ -275,33 +267,32 @@
     </select>
     <select id="selectEvaluationIndicatorList" resultType="java.util.Map">
 
-        select DISTINCT i.id,i.indicator_name,ri.order_num from organization_evaluation_info ei
+        select  DISTINCT i.id,i.indicator_name,ri.order_num from organization_evaluation_info   ei
         LEFT JOIN evaluate_rule_info ri on ei.evaluate_rule_info_id = ri.id
         LEFT JOIN evaluate_rule er on er.id = ri.evaluate_rule_id
         INNER JOIN indicator i on i.id = ri.indicator_id
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and ei.organization_evaluation_id = #{organizationEvaluationId}
+                and  ei.organization_evaluation_id = #{organizationEvaluationId}
             </if>
 
             <if test="binSection !=null and binSection !=''">
-                and er.bin_section = #{binSection}
+                and  er.bin_section = #{binSection}
             </if>
 
             <if test="binStage !=null and binStage !=''">
-                and er.bin_stage = #{binStage}
+                and  er.bin_stage = #{binStage}
             </if>
 
         </where>
 
-        order by ri.order_num asc
+        order by  ri.order_num asc
 
     </select>
 
 
-    <select id="selectEvaluationInfoList"
-            resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
+    <select id="selectEvaluationInfoList" resultType="com.ims.eval.entity.dto.response.OrganizationEvaluationInfoResDTO">
 
         select
         ei.id,
@@ -336,7 +327,7 @@
         inner join organization_evaluation_rule oer on oer.id = ei.organization_evaluation_rule_id
         inner join organization_evaluation oe on oe.id = ei.organization_evaluation_id
         left join indicator i on ei.indicator_id = i.id
-        left join evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
+        left join  evaluate_rule_info ri on ri.indicator_id = i.id and ei.evaluate_rule_info_id = ri.id
         left join bin_stage be on i.bin_stage = be.id
         left join bin_section bn on i.bin_section = bn.id
         left join indicator_type it on i.indicator_type_id = it.id
@@ -345,12 +336,12 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and ei.organization_evaluation_id = #{organizationEvaluationId}
+                and  ei.organization_evaluation_id  = #{organizationEvaluationId}
             </if>
 
 
             <if test="indicatorId !=null and indicatorId !=''">
-                and ei.indicator_id = #{indicatorId}
+                and  ei.indicator_id = #{indicatorId}
             </if>
 
 
@@ -360,21 +351,22 @@
 
 
             <if test="binStage !=null and binStage !=''">
-                and be.id = #{binStage}
+                and  be.id = #{binStage}
             </if>
 
             <if test="organizationId !=null and organizationId !=''">
-                and oer.organization_id = #{organizationId}
+                and  oer.organization_id = #{organizationId}
             </if>
 
 
             <if test="organizationShortName !=null and organizationShortName !=''">
-                and oer.organization_short_name like CONCAT('%',#{organizationShortName},'%')
+                and  oer.organization_short_name  like   CONCAT('%',#{organizationShortName},'%')
             </if>
 
 
-            and id.option_code not in
-            ('CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','LRGXKHMAX','LRGXKHMIN')
+
+
+            and id.option_code not in ('CZMAX','CZMIN','LRGXKLMAX','LRGXKLMIN','DWQWLRMAX','DWQWLRMIN','LRGXKHMAX','LRGXKHMIN')
         </where>
 
         order by oer.order_num asc
@@ -389,10 +381,10 @@
         <where>
 
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
-                and ei.organization_evaluation_id = #{organizationEvaluationId}
+                and  ei.organization_evaluation_id = #{organizationEvaluationId}
             </if>
             <if test="deptId !=null and deptId !=''">
-                and ei.dept_id = #{deptId}
+                and  ei.dept_id = #{deptId}
             </if>
             <if test="state !=null">
                 AND ei.state in
@@ -417,4 +409,5 @@
         order by oei.organization_id asc
     </select>
 
+
 </mapper>