diff --git a/manager-admin/src/main/java/com/hshh/evaluation/entity/EvaluationTemplateWeight.java b/manager-admin/src/main/java/com/hshh/evaluation/entity/EvaluationTemplateWeight.java new file mode 100644 index 0000000..1764769 --- /dev/null +++ b/manager-admin/src/main/java/com/hshh/evaluation/entity/EvaluationTemplateWeight.java @@ -0,0 +1,52 @@ +package com.hshh.evaluation.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import lombok.Data; + +/** + *

+ * 模板指标权重表 + *

+ * + * @author liDongYu + * @since 2025-08-14 + */ +@TableName("m_data_evaluation_template_weight") +@Data +public class EvaluationTemplateWeight implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 顶级指标ID. + */ + private Integer indicatorTopId; + + + private Integer templateId; + + /** + * 指标ID(开始). + */ + private Integer fromIndicatorId; + + + private Integer toIndicatorId; + + /** + * 权重. + */ + private Double weight; + + /** + * 父指标ID. + */ + private int indicatorParentId; + private int rowNum; +} diff --git a/manager-admin/src/main/java/com/hshh/evaluation/mapper/EvaluationTemplateWeightMapper.java b/manager-admin/src/main/java/com/hshh/evaluation/mapper/EvaluationTemplateWeightMapper.java new file mode 100644 index 0000000..81b67fa --- /dev/null +++ b/manager-admin/src/main/java/com/hshh/evaluation/mapper/EvaluationTemplateWeightMapper.java @@ -0,0 +1,16 @@ +package com.hshh.evaluation.mapper; + +import com.hshh.evaluation.entity.EvaluationTemplateWeight; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * 模板指标权重表 Mapper 接口 + *

+ * + * @author liDongYu + * @since 2025-08-14 + */ +public interface EvaluationTemplateWeightMapper extends BaseMapper { + +} diff --git a/manager-admin/src/main/java/com/hshh/evaluation/service/EvaluationTemplateWeightService.java b/manager-admin/src/main/java/com/hshh/evaluation/service/EvaluationTemplateWeightService.java new file mode 100644 index 0000000..4dccddd --- /dev/null +++ b/manager-admin/src/main/java/com/hshh/evaluation/service/EvaluationTemplateWeightService.java @@ -0,0 +1,43 @@ +package com.hshh.evaluation.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.hshh.evaluation.entity.EvaluationTemplateWeight; +import java.util.List; + +/** + * 模板指标权重表 服务类. + * + * @author liDongYu + * @since 2025-08-14 + */ +public interface EvaluationTemplateWeightService extends IService { + + + /** + * 根据模板id+指标id删除. + * + * @param templateId 模板ID + * @param indicatorTopId 顶级指标ID + * @param parentId 上级指标ID + */ + void deleteEvaluationTemplateWeightWithTemplateIdAndIndicatorId(Integer templateId, + Integer indicatorTopId, + Integer parentId); + + /** + * 根据模板ID删除权重信息. + * + * @param templateId 模板ID + */ + void deleteEvaluationTemplateWeightWithTemplateId(Integer templateId); + + /** + * 根据指标父ID和模板id获取权重列表. + * + * @param indicatorParentId 父ID + * @param templateId 模板ID + * @return 权重列表 + */ + List queryListByIndicatorParentIdAndTemplateId( + Integer indicatorParentId, Integer templateId); +} diff --git a/manager-admin/src/main/java/com/hshh/evaluation/service/impl/EvaluationTemplateWeightServiceImpl.java b/manager-admin/src/main/java/com/hshh/evaluation/service/impl/EvaluationTemplateWeightServiceImpl.java new file mode 100644 index 0000000..7a8367f --- /dev/null +++ b/manager-admin/src/main/java/com/hshh/evaluation/service/impl/EvaluationTemplateWeightServiceImpl.java @@ -0,0 +1,54 @@ +package com.hshh.evaluation.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.hshh.evaluation.entity.EvaluationTemplateWeight; +import com.hshh.evaluation.mapper.EvaluationTemplateWeightMapper; +import com.hshh.evaluation.service.EvaluationTemplateWeightService; +import java.util.List; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +/** + *

+ * 模板指标权重表 服务实现类 + *

+ * + * @author liDongYu + * @since 2025-08-14 + */ +@Service +public class EvaluationTemplateWeightServiceImpl extends + ServiceImpl implements + EvaluationTemplateWeightService { + + + @Transactional(rollbackFor = Exception.class) + @Override + public void deleteEvaluationTemplateWeightWithTemplateIdAndIndicatorId(Integer templateId, + Integer indicatorTopId, Integer parentId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("template_id", templateId); + queryWrapper.eq("indicator_top_id", indicatorTopId); + queryWrapper.eq("indicator_parent_id", parentId); + this.remove(queryWrapper); + } + + @Override + public void deleteEvaluationTemplateWeightWithTemplateId(Integer templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("template_id", templateId); + + this.remove(queryWrapper); + } + + @Override + public List queryListByIndicatorParentIdAndTemplateId( + Integer indicatorParentId, Integer templateId) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("template_id", templateId); + + queryWrapper.eq("indicator_parent_id", indicatorParentId); + return this.list(queryWrapper); + } +} diff --git a/manager-admin/src/main/resources/mapper/EvaluationTemplateWeightMapper.xml b/manager-admin/src/main/resources/mapper/EvaluationTemplateWeightMapper.xml new file mode 100644 index 0000000..a6c2442 --- /dev/null +++ b/manager-admin/src/main/resources/mapper/EvaluationTemplateWeightMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/manager-admin/src/main/resources/templates/project_template/table.html b/manager-admin/src/main/resources/templates/project_template/table.html new file mode 100644 index 0000000..2d782f6 --- /dev/null +++ b/manager-admin/src/main/resources/templates/project_template/table.html @@ -0,0 +1,45 @@ + +
+ + + + + + + + + + + + + + + + + + +
+ +
无下级指标
+
\ No newline at end of file