Selaa lähdekoodia

业绩对标管理功能开发

hlf 9 kuukautta sitten
vanhempi
commit
bdcb76d18f

+ 48 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/controller/PerformanceBenchmarkingManageController.java

@@ -1,5 +1,14 @@
 package com.ims.eval.controller;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.ims.eval.entity.PerformanceBenchmarkInfo;
+import com.ims.eval.entity.dto.result.R;
+import com.ims.eval.service.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import javax.annotation.Resource;
+
 /**
  * @author hlf
  * @date 2024/3/21 15:58
@@ -7,6 +16,45 @@ package com.ims.eval.controller;
  */
 public class PerformanceBenchmarkingManageController {
 
+	@Resource
+	private IPerformanceBenchmarkInfoService performanceBenchmarkInfoService;
+
+	@Resource
+	private IEvaluateRuleService evaluateRuleService;
+
+	@Resource
+	private IEvaluateRuleInfoService evaluateRuleInfoService;
+
+	@Resource
+	private IOrganizationEvaluationService organizationEvaluationService;
+
+	@Resource
+	private IOrganizationEvaluationInfoService organizationEvaluationInfoService;
+
+	@Resource
+	private IOrganizationEvaluationRuleService organizationEvaluationRuleService;
 
+	/**
+	 * 业绩对标管理列表信息(分页)
+	 *
+	 * @param pageNum        当前记录起始索引
+	 * @param pageSize       每页显示记录数
+	 * @param manageCategory 经营类别(火电、水电、风电、光伏、煤电、海外、综合)
+	 * @param year           年度
+	 * @param quarter        季度
+	 * @param monthly        月度
+	 * @return 结果
+	 */
+	@GetMapping(value = "/list")
+	public R list(
+		@RequestParam(value = "pageNum") Integer pageNum,
+		@RequestParam(value = "pageSize") Integer pageSize,
+		@RequestParam(value = "manageCategory") String manageCategory,
+		@RequestParam(value = "year", required = false) Integer year,
+		@RequestParam(value = "quarter", required = false) Integer quarter,
+		@RequestParam(value = "monthly", required = false) Integer monthly) {
+		IPage<PerformanceBenchmarkInfo> list = performanceBenchmarkInfoService.listPage(pageNum, pageSize, year, quarter, monthly, manageCategory);
+		return R.ok().data(list);
+	}
 
 }

+ 18 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/dao/PerformanceBenchmarkInfoMapper.java

@@ -0,0 +1,18 @@
+package com.ims.eval.dao;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ims.eval.entity.PerformanceBenchmarkInfo;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * @author hlf
+ * @date 2024/3/28 14:08
+ * 文件说明:
+ */
+public interface PerformanceBenchmarkInfoMapper extends BaseMapper<PerformanceBenchmarkInfo> {
+
+	IPage<PerformanceBenchmarkInfo> selectListPage(Page<PerformanceBenchmarkInfo> page, @Param("year") Integer year, @Param("quarter") Integer quarter, @Param("monthly") Integer monthly, @Param("manageCategory") String manageCategory);
+
+}

+ 93 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/entity/PerformanceBenchmarkInfo.java

@@ -0,0 +1,93 @@
+package com.ims.eval.entity;
+
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * @author hlf
+ * @date 2024/3/28 13:57
+ * 文件说明:
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class PerformanceBenchmarkInfo extends Model {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * 主键
+	 */
+	private String id;
+
+	/**
+	 * 年度
+	 */
+	private Integer year;
+
+	/**
+	 * 季度
+	 */
+	private Integer quarter;
+
+	/**
+	 * 月度
+	 */
+	private Integer monthly;
+
+	/**
+	 * 经营类别(火电、水电、风电、光伏、煤电、海外、综合)
+	 */
+	private String manageCategory;
+
+	/**
+	 * 序号
+	 */
+	private Integer serialNumber;
+
+	/**
+	 * 单位主键
+	 */
+	private String companyId;
+
+	/**
+	 * 单位名称
+	 */
+	private String companyName;
+
+	/**
+	 * 装机容量
+	 */
+	private Double installCapacity;
+
+	/**
+	 * 指标名称
+	 */
+	private String indexName;
+
+	/**
+	 * 计划值
+	 */
+	private Double plannedValue;
+
+	/**
+	 * 实际完成值
+	 */
+	private Double completeValue;
+
+	/**
+	 * 推荐值
+	 */
+	private Double recommendedValue;
+
+	/**
+	 * 定标值
+	 */
+	private Double scalingValue;
+
+	/**
+	 * 是否标杆(1是 0否)
+	 */
+	private String isPole;
+
+}

+ 16 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/IPerformanceBenchmarkInfoService.java

@@ -0,0 +1,16 @@
+package com.ims.eval.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ims.eval.entity.PerformanceBenchmarkInfo;
+
+/**
+ * @author hlf
+ * @date 2024/3/28 14:06
+ * 文件说明:
+ */
+public interface IPerformanceBenchmarkInfoService extends IService<PerformanceBenchmarkInfo> {
+
+	IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, Integer year, Integer quarter, Integer monthly, String manageCategory);
+
+}

+ 29 - 0
ims-service/ims-eval/src/main/java/com/ims/eval/service/impl/PerformanceBenchmarkInfoServiceImpl.java

@@ -0,0 +1,29 @@
+package com.ims.eval.service.impl;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ims.eval.dao.PerformanceBenchmarkInfoMapper;
+import com.ims.eval.entity.PerformanceBenchmarkInfo;
+import com.ims.eval.service.IPerformanceBenchmarkInfoService;
+import org.springframework.stereotype.Service;
+
+/**
+ * @author hlf
+ * @date 2024/3/28 14:07
+ * 文件说明:
+ */
+@Service
+public class PerformanceBenchmarkInfoServiceImpl extends ServiceImpl<PerformanceBenchmarkInfoMapper, PerformanceBenchmarkInfo> implements IPerformanceBenchmarkInfoService {
+
+	@Override
+	public IPage<PerformanceBenchmarkInfo> listPage(Integer pageNum, Integer pageSize, Integer year, Integer quarter, Integer monthly, String manageCategory) {
+		if (null == pageNum || null == pageSize) {
+			throw new RuntimeException("分页参数为空");
+		}
+		//构造分页构造器
+		Page<PerformanceBenchmarkInfo> page = new Page<>(pageNum, pageSize);
+		return baseMapper.selectListPage(page, year, quarter, monthly, manageCategory);
+	}
+
+}

+ 50 - 0
ims-service/ims-eval/src/main/resources/mappers/PerformanceBenchmarkInfoMapper.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ims.eval.dao.PerformanceBenchmarkInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.ims.eval.entity.PerformanceBenchmarkInfo">
+        <id column="id" property="id"/>
+        <result column="year" property="year"/>
+        <result column="quarter" property="quarter"/>
+        <result column="monthly" property="monthly"/>
+        <result column="manage_category" property="manageCategory"/>
+        <result column="serial_number" property="serialNumber"/>
+        <result column="company_id" property="companyId"/>
+        <result column="company_name" property="companyName"/>
+        <result column="install_capacity" property="installCapacity"/>
+        <result column="index_name" property="indexName"/>
+        <result column="planned_value" property="plannedValue"/>
+        <result column="complete_value" property="completeValue"/>
+        <result column="recommended_value" property="recommendedValue"/>
+        <result column="scaling_value" property="scalingValue"/>
+        <result column="is_pole" property="isPole"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="selectPerformanceBenchmarkInfoVo">
+        select id, `year`, quarter, monthly, manage_category, serial_number, company_id, company_name, install_capacity, index_name, planned_value, complete_value, recommended_value, scaling_value, is_pole
+        from performance_benchmark_info
+    </sql>
+
+    <select id="selectListPage" resultType="com.ims.eval.entity.PerformanceBenchmarkInfo">
+        select * from performance_benchmark_info
+        <where>
+            <if test="year != null and year != ''">
+                AND year = #{year}
+            </if>
+            <if test="quarter != null and quarter != ''">
+                AND quarter = #{quarter}
+            </if>
+            <if test="monthly != null and monthly != ''">
+                AND monthly = #{monthly}
+            </if>
+            <if test="manageCategory != null and manageCategory != ''">
+                AND manage_category = #{manageCategory}
+            </if>
+        </where>
+        order by serial_number asc
+    </select>
+
+
+</mapper>