Sfoglia il codice sorgente

考评得分统计数据查询

‘xugp 1 anno fa
parent
commit
e5fa051bbd

+ 91 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/EvaluationScoreCountController.java

@@ -0,0 +1,91 @@
+package com.ims.eval.controller;
+
+
+import com.ims.eval.config.CustomException;
+import com.ims.eval.entity.EvaluationScoreCount;
+import com.ims.eval.entity.dto.result.R;
+import com.ims.eval.service.IEvaluationScoreCountService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * <p>
+ * 考评得分统计 前端控制器
+ * </p>
+ *
+ * @author xugp
+ * @since 2023-03-30
+ */
+@RestController
+@RequestMapping("//score_count")
+public class EvaluationScoreCountController {
+
+	@Autowired
+	private IEvaluationScoreCountService iEvaluationScoreCountService;
+
+
+
+	/**
+	 * 查询
+	 *
+	 * @param organizationEvaluationId       考评记录id
+	 * @param organizationEvaluationRuleId  考评规则id
+	 * @param binStage  code
+	 * @return
+	 */
+	@GetMapping(value = "list")
+	public R list(@RequestParam(value = "organizationEvaluationId", required = false) String organizationEvaluationId,
+				  @RequestParam(value = "organizationEvaluationRuleId", required = false) String organizationEvaluationRuleId,
+				  @RequestParam(value = "binStage", required = false) String binStage) {
+		List<EvaluationScoreCount> list = iEvaluationScoreCountService.getListByEvaluationRuleId(organizationEvaluationId,organizationEvaluationRuleId,binStage);
+		return R.ok().data(list);
+	}
+
+
+	/**
+	 * 添加
+	 *
+	 * @param evaluationScoreCount
+	 * @return
+	 */
+
+	@PostMapping(value = "/save")
+	@ApiOperation(value = "新增(修改)", notes = "新增(修改)")
+	public R addAll(@RequestBody EvaluationScoreCount evaluationScoreCount) {
+
+		try {
+			boolean b = iEvaluationScoreCountService.saveOrUpdate(evaluationScoreCount);
+			if (b) {
+				return R.ok().data(b);
+			} else {
+				return R.error().data("保存失败!");
+			}
+		} catch (CustomException e){
+			return R.customError(e.getMessage()).data("失败!");
+		}
+	}
+
+
+	/**
+	 * 批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@PostMapping(value = "/remove/{ids}")
+	@ApiOperation(value = "删除", notes = "删除")
+	public R deleteAll(@PathVariable("ids") String ids) {
+		String[] strings = ids.split(",");
+		boolean b = iEvaluationScoreCountService.removeByIds(Arrays.asList(strings));
+		if (b) {
+			return R.ok().data(b);
+		} else {
+			return R.error().data("删除失败!");
+		}
+	}
+
+}

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

@@ -1,12 +1,9 @@
 package com.ims.eval.entity;
 
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
-import lombok.Builder;
-import lombok.Data;
-import lombok.EqualsAndHashCode;
+import lombok.*;
 
-import java.time.LocalDate;
-import java.util.Date;
 
 /**
  * <p>
@@ -43,6 +40,8 @@ public class EvaluationScoreCount extends Model {
      */
     private String indicatorId;
 
+
+
     /**
      * 得分
      */
@@ -54,8 +53,9 @@ public class EvaluationScoreCount extends Model {
 	private double obversionScore;
 
 	/**
-	 * 能否量化
+	 * 能否量化  1 代表能  0代表否
 	 */
-	private Boolean isQuantified;
+	private String isQuantified;
+
 
 }

+ 81 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/dto/response/EvaluationScoreCountDTO.java

@@ -0,0 +1,81 @@
+package com.ims.eval.entity.dto.response;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import io.swagger.annotations.ApiModel;
+import lombok.Data;
+
+@Data
+public class EvaluationScoreCountDTO {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	private String id;
+
+
+	/**
+	 * 考评记录id
+	 */
+	private String organizationEvaluationId;
+
+	/**
+	 * 考评规则id
+	 */
+	private String organizationEvaluationRuleId;
+
+	/**
+	 * 指标id
+	 */
+	private String indicatorId;
+
+	/**
+	 * 单位名称
+	 */
+	private String organizationName;
+
+
+	/**
+	 * 经营阶段分类
+	 */
+	private String sectionName;
+
+	/**
+	 * 生产经营业务分类
+	 */
+	private String stageName;
+
+
+	/**
+	 * 指标名称
+	 */
+	private String indicatorName;
+
+	/**
+	 * 部门名称
+	 */
+	private String keyName;
+
+
+	/**
+	 * 得分
+	 */
+	private double score;
+
+
+
+	/**
+	 * 折算得分
+	 */
+	private double obversionScore;
+
+	/**
+	 * 能否量化  1 代表能  0代表否
+	 */
+	private String isQuantified;
+
+
+
+
+}

+ 2 - 2
ims-service/ims-eval/src/main/java/com/ims/eval/schedule/ScoreCalculationSchedule.java

@@ -61,7 +61,7 @@ public class ScoreCalculationSchedule {
 			if (StringUtils.isNotEmpty(id)) {
 				qw1.lambda().eq(EvaluationScoreCount::getOrganizationEvaluationId, id);
 			}
-			qw1.lambda().eq(EvaluationScoreCount::getIsQuantified, true);
+			qw1.lambda().eq(EvaluationScoreCount::getIsQuantified, "1");
 			List<EvaluationScoreCount> evaluationScoreCountList = iEvaluatioinScoreCountService.list(qw1);
 			if (evaluationScoreCountList.size() >0){
 				List<String> idList = evaluationScoreCountList.stream().map(EvaluationScoreCount::getId).collect(Collectors.toList());
@@ -105,7 +105,7 @@ public class ScoreCalculationSchedule {
 									.organizationEvaluationRuleId(entry.getKey())
 									.organizationEvaluationId(organizationEvaluation.getId())
 									.score(Double.parseDouble(calculation))
-									.isQuantified(true)
+									.isQuantified("1")
 									.obversionScore(Double.parseDouble(calculation))
 									.build();
 								save = iEvaluatioinScoreCountService.save(evaluationScoreCount);

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

@@ -16,10 +16,15 @@
         id, organization_evaluation_id, indicator_id, score, organization_evaluation_rule_id
     </sql>
 
-    <select id="selelctListByEvaluationRuleId" resultType="com.ims.eval.entity.EvaluationScoreCount">
-        select c.*
+    <select id="selelctListByEvaluationRuleId" resultType="com.ims.eval.entity.dto.response.EvaluationScoreCountDTO">
+        select c.*,i.indicator_name,o.organization_name,b.section_name,s.stage_name,d.key_name
         from evaluation_score_count c
         LEFT JOIN indicator i on  c.indicator_id = i.id
+        LEFT JOIN organization_evaluation_rule o on  c.organization_evaluation_id = o.id
+        left join bin_section b on b.id = i.bin_section
+        left join bin_stage s on s.id = i.bin_stage
+        left join data_dictionary d on d.data_key = i.dept
+
         <where>
             <if test="organizationEvaluationId !=null and organizationEvaluationId !=''">
                 AND c.organization_evaluation_id = #{organizationEvaluationId}