!1 fix bug
Merge pull request !1 from zhitan-cloud/develop1.0
| | |
| | | <?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"> |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dingzhuo.energy.data.model.mapper.ModelNodeMapper"> |
| | | |
| | | <resultMap type="com.dingzhuo.energy.data.model.domain.ModelNode" id="ModelNodeResult"> |
| | | <result property="nodeId" column="node_id"/> |
| | | <result property="code" column="code"/> |
| | | <result property="name" column="name"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="address" column="address"/> |
| | | <result property="modelCode" column="model_code"/> |
| | | <result property="nodeCategory" column="node_category"/> |
| | | </resultMap> |
| | | <resultMap type="com.dingzhuo.energy.data.model.domain.ModelNode" id="ModelNodeResult"> |
| | | <result property="nodeId" column="node_id"/> |
| | | <result property="code" column="code"/> |
| | | <result property="name" column="name"/> |
| | | <result property="parentId" column="parent_id"/> |
| | | <result property="address" column="address"/> |
| | | <result property="modelCode" column="model_code"/> |
| | | <result property="nodeCategory" column="node_category"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectModelNodeVo"> |
| | | select node_id, code, name, parent_id, address, model_code, node_category |
| | | from model_node |
| | | </sql> |
| | | <sql id="selectModelNodeVo"> |
| | | select node_id, code, name, parent_id, address, model_code, node_category |
| | | from model_node |
| | | </sql> |
| | | |
| | | <select id="selectModelNodeList" |
| | | parameterType="com.dingzhuo.energy.data.model.domain.ModelNode" |
| | | resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | <where> |
| | | <if test="code != null and code != ''">and code like concat('%', #{code}, '%')</if> |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | | </where> |
| | | order by order_num |
| | | </select> |
| | | <select id="selectModelNodeList" |
| | | parameterType="com.dingzhuo.energy.data.model.domain.ModelNode" |
| | | resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | <where> |
| | | <if test="code != null and code != ''">and code like concat('%', #{code}, '%')</if> |
| | | <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if> |
| | | </where> |
| | | order by order_num |
| | | </select> |
| | | |
| | | <select id="selectModelNodeById" parameterType="String" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where node_id = #{nodeId} |
| | | </select> |
| | | <select id="getModelNodeByModelCode" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where model_code = #{modelCode} |
| | | order by order_num |
| | | </select> |
| | | <select id="getMaxOrder" resultType="java.lang.Integer"> |
| | | select COALESCE(max(order_num), 0) |
| | | from model_node |
| | | where parent_id = #{parentId} |
| | | </select> |
| | | <select id="modelNodeHasExist" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from model_node |
| | | where code = #{code} |
| | | and model_code = #{modelCode}; |
| | | </select> |
| | | <select id="modelNodeHasExistWhenUpdate" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from model_node |
| | | where code = #{code} |
| | | and model_code = #{modelCode} |
| | | AND node_id != #{nodeId}; |
| | | </select> |
| | | <select id="getSettingDevice" |
| | | resultType="com.dingzhuo.energy.basic.data.meter.domain.MeterImplement"> |
| | | select id, code, meter_name as meterName |
| | | from meter_implement m |
| | | left join node_device nd on m.id = nd.device_id |
| | | where nd.node_id = #{nodeId}; |
| | | </select> |
| | | <select id="getSettingIndex" |
| | | resultType="com.dingzhuo.energy.data.model.domain.EnergyIndex"> |
| | | select ei.index_id as indexId, code, name, index_type as indexType |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id = #{nodeId} |
| | | </select> |
| | | <select id="getSettingEnergy" |
| | | resultType="com.dingzhuo.energy.basic.data.enerInfoManage.domain.SysEnergy"> |
| | | select enerid, enersno, enername |
| | | from sys_energy e |
| | | left join node_energy ne on e.enerid = ne.energy_id |
| | | where ne.node_id = #{nodeId}; |
| | | </select> |
| | | <select id="getSettingProduct" |
| | | resultType="com.dingzhuo.energy.basic.data.enerInfoManage.domain.SysProduct"> |
| | | select productid, productsno, productname |
| | | from sys_product p |
| | | left join node_product np on p.productid = np.product_id |
| | | where np.node_id = #{nodeId}; |
| | | </select> |
| | | <select id="getSettingIndexByType" |
| | | resultType="com.dingzhuo.energy.data.model.domain.EnergyIndex"> |
| | | select ei.index_id as indexId, code, name, index_type as indexType |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id = #{nodeId} |
| | | and ei.index_type = #{indexType} |
| | | </select> |
| | | <select id="getModelNodeByNodeCodes" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where code in |
| | | <foreach item="nodeCode" collection="list" open="(" separator="," close=")"> |
| | | #{nodeCode} |
| | | </foreach> |
| | | order by order_num |
| | | </select> |
| | | <select id="getModelNodeByModelCodeWithAuth" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where model_code = #{modelCode} |
| | | and ( |
| | | node_id in ( |
| | | <select id="selectModelNodeById" parameterType="String" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where node_id = #{nodeId} |
| | | </select> |
| | | <select id="getModelNodeByModelCode" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where model_code = #{modelCode} |
| | | order by order_num |
| | | </select> |
| | | <select id="getMaxOrder" resultType="java.lang.Integer"> |
| | | select COALESCE(max(order_num), 0) |
| | | from model_node |
| | | where parent_id = #{parentId} |
| | | </select> |
| | | <select id="modelNodeHasExist" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from model_node |
| | | where code = #{code} |
| | | and model_code = #{modelCode}; |
| | | </select> |
| | | <select id="modelNodeHasExistWhenUpdate" resultType="java.lang.Integer"> |
| | | select count(*) |
| | | from model_node |
| | | where code = #{code} |
| | | and model_code = #{modelCode} |
| | | AND node_id != #{nodeId}; |
| | | </select> |
| | | <select id="getSettingDevice" |
| | | resultType="com.dingzhuo.energy.basic.data.meter.domain.MeterImplement"> |
| | | select id, code, meter_name as meterName |
| | | from meter_implement m |
| | | left join node_device nd on m.id = nd.device_id |
| | | where nd.node_id = #{nodeId}; |
| | | </select> |
| | | <select id="getSettingIndex" |
| | | resultType="com.dingzhuo.energy.data.model.domain.EnergyIndex"> |
| | | select ei.index_id as indexId, code, name, index_type as indexType |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id = #{nodeId} |
| | | </select> |
| | | <select id="getSettingEnergy" |
| | | resultType="com.dingzhuo.energy.basic.data.enerInfoManage.domain.SysEnergy"> |
| | | select enerid, enersno, enername |
| | | from sys_energy e |
| | | left join node_energy ne on e.enerid = ne.energy_id |
| | | where ne.node_id = #{nodeId}; |
| | | </select> |
| | | <select id="getSettingProduct" |
| | | resultType="com.dingzhuo.energy.basic.data.enerInfoManage.domain.SysProduct"> |
| | | select productid, productsno, productname |
| | | from sys_product p |
| | | left join node_product np on p.productid = np.product_id |
| | | where np.node_id = #{nodeId}; |
| | | </select> |
| | | <select id="getSettingIndexByType" |
| | | resultType="com.dingzhuo.energy.data.model.domain.EnergyIndex"> |
| | | select ei.index_id as indexId, code, name, index_type as indexType |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id = #{nodeId} |
| | | and ei.index_type = #{indexType} |
| | | </select> |
| | | <select id="getModelNodeByNodeCodes" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where code in |
| | | <foreach item="nodeCode" collection="list" open="(" separator="," close=")"> |
| | | #{nodeCode} |
| | | </foreach> |
| | | order by order_num |
| | | </select> |
| | | <select id="getModelNodeByModelCodeWithAuth" resultMap="ModelNodeResult"> |
| | | <include refid="selectModelNodeVo"/> |
| | | where model_code = #{modelCode} |
| | | and ( |
| | | node_id in ( |
| | | select node_id from data_auth_user where user_id = #{userId} and model_code = #{modelCode} |
| | | ) |
| | | or node_id in ( |
| | | ) |
| | | or node_id in ( |
| | | select node_id from data_auth_role where role_id in ( |
| | | select cast(r.role_id as varchar) from sys_role r |
| | | left join sys_user_role ur on ur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = ur.user_id |
| | | where cast(u.user_id as VARCHAR) = #{userId} |
| | | select cast(r.role_id as varchar) from sys_role r |
| | | left join sys_user_role ur on ur.role_id = r.role_id |
| | | left join sys_user u on u.user_id = ur.user_id |
| | | where cast(u.user_id as VARCHAR) = #{userId} |
| | | ) and model_code = #{modelCode} |
| | | ) |
| | | ) |
| | | order by order_num |
| | | </select> |
| | | ) |
| | | ) |
| | | order by order_num |
| | | </select> |
| | | |
| | | <insert id="insertModelNode" |
| | | parameterType="com.dingzhuo.energy.data.model.domain.ModelNode"> |
| | | insert into model_node |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="nodeId != null and nodeId != ''">node_id,</if> |
| | | <if test="code != null and code != ''">code,</if> |
| | | <if test="name != null and name != ''">name,</if> |
| | | <if test="parentId != null and parentId != ''">parent_id,</if> |
| | | <if test="address != null and address != ''">address,</if> |
| | | <if test="modelCode != null and modelCode != ''">model_code,</if> |
| | | <if test="nodeCategory != null and nodeCategory != ''">node_category,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="nodeId != null and nodeId != ''">#{nodeId},</if> |
| | | <if test="code != null and code != ''">#{code},</if> |
| | | <if test="name != null and name != ''">#{name},</if> |
| | | <if test="parentId != null and parentId != ''">#{parentId},</if> |
| | | <if test="address != null and address != ''">#{address},</if> |
| | | <if test="modelCode != null and modelCode != ''">#{modelCode},</if> |
| | | <if test="nodeCategory != null and nodeCategory != ''">#{nodeCategory},</if> |
| | | </trim> |
| | | </insert> |
| | | <insert id="setDevice"> |
| | | delete |
| | | from node_device |
| | | where node_id = #{nodeId}; |
| | | <foreach collection="deviceIds" item="deviceId" separator=";"> |
| | | insert into node_device (node_id, device_id) |
| | | values (#{nodeId}, #{deviceId}) |
| | | </foreach> |
| | | </insert> |
| | | <insert id="setEnergy"> |
| | | delete |
| | | from node_energy |
| | | where node_id = #{nodeId}; |
| | | <foreach collection="energyIds" item="energyId" separator=";"> |
| | | insert into node_energy (node_id, energy_id) |
| | | values (#{nodeId}, #{energyId}) |
| | | </foreach> |
| | | </insert> |
| | | <insert id="setProduct"> |
| | | delete |
| | | from node_product |
| | | where node_id = #{nodeId}; |
| | | <foreach collection="productIds" item="productId" separator=";"> |
| | | insert into node_product (node_id, product_id) |
| | | values (#{nodeId}, #{productId}) |
| | | </foreach> |
| | | </insert> |
| | | <insert id="insertModelNode" |
| | | parameterType="com.dingzhuo.energy.data.model.domain.ModelNode"> |
| | | insert into model_node |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="nodeId != null and nodeId != ''">node_id,</if> |
| | | <if test="code != null and code != ''">code,</if> |
| | | <if test="name != null and name != ''">name,</if> |
| | | <if test="parentId != null and parentId != ''">parent_id,</if> |
| | | <if test="address != null and address != ''">address,</if> |
| | | <if test="modelCode != null and modelCode != ''">model_code,</if> |
| | | <if test="nodeCategory != null and nodeCategory != ''">node_category,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="nodeId != null and nodeId != ''">#{nodeId},</if> |
| | | <if test="code != null and code != ''">#{code},</if> |
| | | <if test="name != null and name != ''">#{name},</if> |
| | | <if test="parentId != null and parentId != ''">#{parentId},</if> |
| | | <if test="address != null and address != ''">#{address},</if> |
| | | <if test="modelCode != null and modelCode != ''">#{modelCode},</if> |
| | | <if test="nodeCategory != null and nodeCategory != ''">#{nodeCategory},</if> |
| | | </trim> |
| | | </insert> |
| | | <insert id="setDevice"> |
| | | delete |
| | | from node_device |
| | | where node_id = #{nodeId}; |
| | | <foreach collection="deviceIds" item="deviceId" separator=";"> |
| | | insert into node_device (node_id, device_id) |
| | | values (#{nodeId}, #{deviceId}) |
| | | </foreach> |
| | | </insert> |
| | | <insert id="setEnergy"> |
| | | delete |
| | | from node_energy |
| | | where node_id = #{nodeId}; |
| | | <foreach collection="energyIds" item="energyId" separator=";"> |
| | | insert into node_energy (node_id, energy_id) |
| | | values (#{nodeId}, #{energyId}) |
| | | </foreach> |
| | | </insert> |
| | | <insert id="setProduct"> |
| | | delete |
| | | from node_product |
| | | where node_id = #{nodeId}; |
| | | <foreach collection="productIds" item="productId" separator=";"> |
| | | insert into node_product (node_id, product_id) |
| | | values (#{nodeId}, #{productId}) |
| | | </foreach> |
| | | </insert> |
| | | |
| | | <update id="updateModelNode" |
| | | parameterType="com.dingzhuo.energy.data.model.domain.ModelNode"> |
| | | update model_node |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="code != null and code != ''">code = #{code},</if> |
| | | <if test="name != null and name != ''">name = #{name},</if> |
| | | <if test="parentId != null and parentId != ''">parent_id = #{parentId},</if> |
| | | <if test="address != null and address != ''">address = #{address},</if> |
| | | <if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if> |
| | | <if test="nodeCategory != null and nodeCategory != ''">node_category = #{nodeCategory},</if> |
| | | </trim> |
| | | where node_id = #{nodeId} |
| | | </update> |
| | | <update id="updateModelNodeParent"> |
| | | update model_node |
| | | set parent_id = #{parentId} |
| | | where node_id = #{nodeId}; |
| | | <update id="updateModelNode" |
| | | parameterType="com.dingzhuo.energy.data.model.domain.ModelNode"> |
| | | update model_node |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="code != null and code != ''">code = #{code},</if> |
| | | <if test="name != null and name != ''">name = #{name},</if> |
| | | <if test="parentId != null and parentId != ''">parent_id = #{parentId},</if> |
| | | <if test="address != null and address != ''">address = #{address},</if> |
| | | <if test="modelCode != null and modelCode != ''">model_code = #{modelCode},</if> |
| | | <if test="nodeCategory != null and nodeCategory != ''">node_category = #{nodeCategory},</if> |
| | | </trim> |
| | | where node_id = #{nodeId} |
| | | </update> |
| | | <update id="updateModelNodeParent"> |
| | | update model_node |
| | | set parent_id = #{parentId} |
| | | where node_id = #{nodeId}; |
| | | |
| | | update model_node |
| | | set address = replace(address, (select address from model_node where node_id = #{nodeId}), |
| | | (select address || |
| | | (select code from model_node where node_id = #{nodeId}) || |
| | | ',' |
| | | from model_node |
| | | where node_id = #{parentId})) |
| | | where parent_id = #{nodeId} |
| | | or node_id = #{nodeId}; |
| | | </update> |
| | | <update id="updateModelNodeOrder"> |
| | | <foreach collection="orders" index="id" item="order" separator=";"> |
| | | update model_node |
| | | set order_num = #{order} |
| | | where node_id = #{id} |
| | | </foreach> |
| | | </update> |
| | | <update id="setIndex"> |
| | | delete |
| | | from node_index |
| | | where node_id = #{nodeId} and index_id in (select ni.index_id |
| | | from node_index ni left join energy_index ei on ni.index_id = ei.index_id |
| | | where node_id = #{nodeId} and ei.index_type = #{indexType}); |
| | | <foreach collection="indexIds" item="indexId" separator=";"> |
| | | insert into node_index (node_id, index_id) |
| | | values (#{nodeId}, #{indexId}) |
| | | </foreach> |
| | | </update> |
| | | update model_node |
| | | set address = replace(address, (select address from model_node where node_id = #{nodeId}), |
| | | (select address || |
| | | (select code from model_node where node_id = #{nodeId}) || |
| | | ',' |
| | | from model_node |
| | | where node_id = #{parentId})) |
| | | where parent_id = #{nodeId} |
| | | or node_id = #{nodeId}; |
| | | </update> |
| | | <update id="updateModelNodeOrder"> |
| | | <foreach collection="orders" index="id" item="order" separator=";"> |
| | | update model_node |
| | | set order_num = #{order} |
| | | where node_id = #{id} |
| | | </foreach> |
| | | </update> |
| | | <update id="setIndex"> |
| | | delete |
| | | from node_index |
| | | where node_id = #{nodeId} and index_id in (select ni.index_id |
| | | from node_index ni left join energy_index ei on ni.index_id = ei.index_id |
| | | where node_id = #{nodeId} and ei.index_type = #{indexType}); |
| | | <foreach collection="indexIds" item="indexId" separator=";"> |
| | | insert into node_index (node_id, index_id) |
| | | values (#{nodeId}, #{indexId}) |
| | | </foreach> |
| | | </update> |
| | | |
| | | <delete id="deleteModelNodeById" parameterType="String"> |
| | | delete |
| | | from model_node |
| | | where node_id = #{nodeId} |
| | | </delete> |
| | | <delete id="deleteModelNodeById" parameterType="String"> |
| | | delete |
| | | from model_node |
| | | where node_id = #{nodeId} |
| | | </delete> |
| | | |
| | | <delete id="deleteModelNodeByIds" parameterType="String"> |
| | | delete from model_node where node_id in |
| | | <foreach item="nodeId" collection="array" open="(" separator="," close=")"> |
| | | #{nodeId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delDevice"> |
| | | delete |
| | | from node_device |
| | | where node_id = #{nodeId} and device_id in |
| | | <foreach item="deviceId" collection="deviceIds" open="(" separator="," close=")"> |
| | | #{deviceId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delEnergy"> |
| | | delete |
| | | from node_energy |
| | | where node_id = #{nodeId} and energy_id in |
| | | <foreach item="energyId" collection="energyIds" open="(" separator="," close=")"> |
| | | #{energyId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delProduct"> |
| | | delete |
| | | from node_product |
| | | where node_id = #{nodeId} and product_id in |
| | | <foreach item="productId" collection="productIds" open="(" separator="," close=")"> |
| | | #{productId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delIndex"> |
| | | delete |
| | | from node_index |
| | | where node_id = #{nodeId} and index_id in |
| | | <foreach item="indexId" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="deleteModelNodeByIds" parameterType="String"> |
| | | delete from model_node where node_id in |
| | | <foreach item="nodeId" collection="array" open="(" separator="," close=")"> |
| | | #{nodeId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delDevice"> |
| | | delete |
| | | from node_device |
| | | where node_id = #{nodeId} and device_id in |
| | | <foreach item="deviceId" collection="deviceIds" open="(" separator="," close=")"> |
| | | #{deviceId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delEnergy"> |
| | | delete |
| | | from node_energy |
| | | where node_id = #{nodeId} and energy_id in |
| | | <foreach item="energyId" collection="energyIds" open="(" separator="," close=")"> |
| | | #{energyId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delProduct"> |
| | | delete |
| | | from node_product |
| | | where node_id = #{nodeId} and product_id in |
| | | <foreach item="productId" collection="productIds" open="(" separator="," close=")"> |
| | | #{productId} |
| | | </foreach> |
| | | </delete> |
| | | <delete id="delIndex"> |
| | | delete |
| | | from node_index |
| | | where node_id = #{nodeId} and index_id in |
| | | <foreach item="indexId" collection="indexIds" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | </delete> |
| | | |
| | | <select id="getSettingIndexByWhere" |
| | | resultType="com.dingzhuo.energy.data.model.domain.EnergyIndex"> |
| | | select ei.index_id as indexId, code, name, index_type as indexType |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id = #{nodeId} |
| | | <if test="indexName!=null and indexName!=''"> |
| | | and ei.name like concat('%', #{indexName}, '%') |
| | | </if> |
| | | </select> |
| | | <select id="getSettingIndexByWhere" |
| | | resultType="com.dingzhuo.energy.data.model.domain.EnergyIndex"> |
| | | select ei.index_id as indexId, code, name, index_type as indexType |
| | | from energy_index ei |
| | | left join node_index ni on ei.index_id = ni.index_id |
| | | where ni.node_id = #{nodeId} |
| | | <if test="indexName!=null and indexName!=''"> |
| | | and ei.name like concat('%', #{indexName}, '%') |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="listIndesxByCodeList" resultType="java.lang.String"> |
| | | SELECT |
| | | index_id |
| | | FROM |
| | | "node_index" |
| | | WHERE |
| | | node_id IN |
| | | <foreach item="nodeId" collection="nodeIds" open="(" separator="," close=")"> |
| | | #{nodeId} |
| | | </foreach> |
| | | </select> |
| | | <select id="listIndesxByCodeList" resultType="java.lang.String"> |
| | | SELECT |
| | | index_id |
| | | FROM |
| | | "node_index" |
| | | WHERE |
| | | node_id IN |
| | | <foreach item="nodeId" collection="nodeIds" open="(" separator="," close=")"> |
| | | #{nodeId} |
| | | </foreach> |
| | | </select> |
| | | |
| | | <select id="getModelNodeIndexIdRelationInforByCode" |
| | | resultType="com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor"> |
| | | SELECT |
| | | mn.node_id nodeId, |
| | | mn."name" name, |
| | | ni.index_id indexId |
| | | FROM |
| | | "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | WHERE |
| | | mn.model_code = #{code} |
| | | AND mn.parent_id IS NOT NULL |
| | | </select> |
| | | <select id="getModelNodeIndexIdRelationInforByCode" |
| | | resultType="com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" name, |
| | | ni.index_id indexId |
| | | FROM "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | WHERE mn.model_code = #{code} |
| | | AND mn.parent_id IS NOT NULL |
| | | </select> |
| | | |
| | | <select id="listModelNodeIndexIdRelationInforByParentId" resultType="com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor"> |
| | | SELECT |
| | | mn.node_id nodeId, |
| | | mn."name" name, |
| | | ni.index_id indexId |
| | | FROM |
| | | "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | WHERE |
| | | mn.parent_id = #{parentId} |
| | | </select> |
| | | <select id="listModelNodeIndexIdRelationInforByParentId" |
| | | resultType="com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" name, |
| | | ni.index_id indexId |
| | | FROM "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | WHERE mn.parent_id = #{parentId} |
| | | </select> |
| | | |
| | | <select id="getModelNodeIndexIdRelationInforByNodeId" |
| | | resultType="com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor"> |
| | | SELECT |
| | | mn.node_id nodeId, |
| | | mn."name" name, |
| | | ni.index_id indexId |
| | | FROM |
| | | "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | WHERE |
| | | mn.node_id = #{nodeId} |
| | | </select> |
| | | <select id="getModelNodeIndexIdRelationInforByNodeId" |
| | | resultType="com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name" name, |
| | | ni.index_id indexId |
| | | FROM "model_node" mn |
| | | LEFT JOIN "node_index" ni ON mn.node_id = ni.node_id |
| | | WHERE mn.node_id = #{nodeId} |
| | | </select> |
| | | |
| | | <select id="getModelNodeByModelCodeByIndexCode" resultType="com.dingzhuo.energy.data.model.domain.ModelNode"> |
| | | SELECT |
| | | node_id nodeId, |
| | | code, |
| | | "name", |
| | | parent_id parentId, |
| | | address, |
| | | model_code modelCode, |
| | | node_category nodeCategory |
| | | FROM |
| | | "model_node" |
| | | WHERE |
| | | model_code = #{indexCode} |
| | | AND parent_id IS NULL |
| | | LIMIT 1; |
| | | </select> |
| | | <select id="getModelNodeByModelCodeByIndexCode" resultType="com.dingzhuo.energy.data.model.domain.ModelNode"> |
| | | SELECT node_id nodeId, |
| | | code, |
| | | "name", |
| | | parent_id parentId, |
| | | address, |
| | | model_code modelCode, |
| | | node_category nodeCategory |
| | | FROM "model_node" |
| | | WHERE model_code = #{indexCode} |
| | | AND parent_id IS NULL LIMIT 1; |
| | | </select> |
| | | <select id="selectIndexByModelCodeAndNodeId" |
| | | resultType="com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor"> |
| | | SELECT mn.node_id nodeId, |
| | | mn."name", |
| | | ni.index_id indexId |
| | | FROM model_node mn |
| | | LEFT JOIN node_index ni ON ni.node_id = mn.node_id |
| | | WHERE mn.model_code = #{modelCode} |
| | | AND mn.node_id = #{nodeId} |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.controller; |
| | | |
| | | |
| | | import com.dingzhuo.energy.framework.web.controller.BaseController; |
| | | import com.dingzhuo.energy.framework.web.domain.AjaxResult; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityDataItemListDTO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.service.IElectricityDataItemService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * å°å³°å¹³è°·æ°æ®Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-19 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/electricityDataItem") |
| | | @Api(tags = "å°å³°å¹³è°·æ°æ®") |
| | | public class ElectricityDataItemController extends BaseController { |
| | | |
| | | @Resource |
| | | private IElectricityDataItemService rulesService; |
| | | |
| | | |
| | | /** |
| | | * è·åå°å³°å¹³è°·æ°æ®ç»è®¡ |
| | | */ |
| | | @GetMapping("/getDataStatistics") |
| | | @ApiOperation(value = "è·åå°å³°å¹³è°·æ°æ®ç»è®¡") |
| | | public AjaxResult getDataStatistics(ElectricityDataItemListDTO dto) { |
| | | return AjaxResult.success(rulesService.getDataStatistics(dto)); |
| | | } |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.controller; |
| | | |
| | | import com.dingzhuo.energy.framework.aspectj.lang.annotation.Log; |
| | | import com.dingzhuo.energy.framework.aspectj.lang.enums.BusinessType; |
| | | import com.dingzhuo.energy.framework.web.controller.BaseController; |
| | | import com.dingzhuo.energy.framework.web.domain.AjaxResult; |
| | | import com.dingzhuo.energy.framework.web.page.TableDataInfo; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingAddVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingUpdateVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingItemQueryVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingPageListVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.service.IElectricityTypeSettingService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计费çç¥Controller |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-19 |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/rule") |
| | | @Api(tags = "计费çç¥") |
| | | public class ElectricityTypeSettingController extends BaseController { |
| | | |
| | | @Resource |
| | | private IElectricityTypeSettingService rulesService; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¡è´¹è§åå表 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "å页æ¥è¯¢è®¡è´¹è§åå表") |
| | | public TableDataInfo list(@ApiParam("计费è§ååç§°") @RequestParam(value = "name", required = false) String name) { |
| | | startPage(); |
| | | List<ElectricityTypeSettingPageListVO> responsePage = rulesService.selectPageList(name); |
| | | return getDataTable(responsePage); |
| | | } |
| | | |
| | | /** |
| | | * è·å计费è§å详æ
|
| | | */ |
| | | @GetMapping(value = "/getRuleDetail") |
| | | @ApiOperation(value = "è·å计费è§å详æ
") |
| | | public AjaxResult getRuleDetail(@ApiParam("计费è§åid") @NotNull(message = "idä¸è½ä¸ºç©º!") @RequestParam("id") String id) { |
| | | ElectricityTypeSettingItemQueryVO response = rulesService.getRuleDetail(id); |
| | | return AjaxResult.success(response); |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¡è´¹çç¥ |
| | | */ |
| | | @PostMapping("/addRule") |
| | | @ApiOperation(value = "æ°å¢è®¡è´¹çç¥") |
| | | @Log(title = "æ°å¢è®¡è´¹çç¥", businessType = BusinessType.INSERT) |
| | | public AjaxResult addRule(@RequestBody @Validated ElectricityTypeSettingAddVO request) { |
| | | rulesService.addRule(request); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¡è´¹çç¥ |
| | | */ |
| | | @PostMapping("/updateRule") |
| | | @ApiOperation(value = "ä¿®æ¹è®¡è´¹çç¥") |
| | | @Log(title = "ä¿®æ¹è®¡è´¹çç¥", businessType = BusinessType.UPDATE) |
| | | public AjaxResult updateRule(@RequestBody @Validated ElectricityTypeSettingUpdateVO request) { |
| | | rulesService.updateRule(request); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¡è´¹çç¥ |
| | | */ |
| | | @DeleteMapping("/delRule/{id}") |
| | | @ApiOperation(value = "å é¤è®¡è´¹çç¥") |
| | | @Log(title = "å é¤è®¡è´¹çç¥", businessType = BusinessType.DELETE) |
| | | public AjaxResult delRule(@ApiParam("计费è§åid") @NotNull(message = "idä¸è½ä¸ºç©º!") @PathVariable("id") String id) { |
| | | rulesService.delRule(id); |
| | | return AjaxResult.success(); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.dto; |
| | | |
| | | import com.dingzhuo.energy.common.utils.time.TimeType; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.util.Date; |
| | | |
| | | |
| | | /** |
| | | * å°å³°å¹³è°·æ°æ®å表å®ä½ç±» electricityDataItem |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-19 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "å°å³°å¹³è°·æ°æ®å表å®ä½ç±»") |
| | | public class ElectricityDataItemListDTO { |
| | | |
| | | /** |
| | | * 模åç¼å· |
| | | */ |
| | | @ApiModelProperty(value = "模åç¼å·") |
| | | @NotBlank(message = "模åç¼å·ä¸è½ä¸ºç©º!") |
| | | private String modelCode; |
| | | |
| | | /** |
| | | * èç¹id |
| | | */ |
| | | @ApiModelProperty(value = "èç¹id") |
| | | @NotBlank(message = "èç¹idä¸è½ä¸ºç©º!") |
| | | private String nodeId; |
| | | |
| | | /** |
| | | * æ¶é´ç±»å |
| | | */ |
| | | @ApiModelProperty(value = "æ¶é´ç±»å") |
| | | @NotBlank(message = "æ¶é´ç±»åä¸è½ä¸ºç©º!") |
| | | private String timeType; |
| | | |
| | | /** |
| | | * æ¥è¯¢æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "æ¥è¯¢æ¶é´") |
| | | @NotNull(message = "æ¥è¯¢æ¶é´ä¸è½ä¸ºç©º!") |
| | | @DateTimeFormat(pattern = "yyyy-MM") |
| | | private Date queryTime; |
| | | |
| | | |
| | | public String getTimeType() { |
| | | |
| | | switch (TimeType.valueOf(this.timeType)) { |
| | | case HOUR: |
| | | case DAY: |
| | | return TimeType.HOUR.name(); |
| | | case MONTH: |
| | | return TimeType.DAY.name(); |
| | | case YEAR: |
| | | return TimeType.MONTH.name(); |
| | | default: |
| | | return TimeType.DAY.name(); |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.DecimalMin; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计费è§å对象 rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-19 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "计费è§åæ°å¢è¯·æ±å®ä½ç±»") |
| | | public class ElectricityTypeSettingAddVO { |
| | | |
| | | /** |
| | | * è§ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "è§ååç§°") |
| | | @NotBlank(message = "è§ååç§°ä¸è½ä¸ºç©º!") |
| | | private String name; |
| | | |
| | | /** |
| | | * çææ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "çææ¶é´") |
| | | @NotNull(message = "çææ¶é´ä¸è½ä¸ºç©º!") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date effectiveDate; |
| | | |
| | | /** |
| | | * å°æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å°æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "å°æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "å°æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal sharpFee; |
| | | |
| | | /** |
| | | * å³°æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å³°æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "å³°æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "å³°æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal peakFee; |
| | | |
| | | /** |
| | | * å¹³æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¹³æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "å¹³æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "å¹³æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal flatFee; |
| | | |
| | | /** |
| | | * è°·æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "è°·æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "è°·æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "è°·æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal valleyFee; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 计费çç¥è¯¦æ
å表 |
| | | */ |
| | | @ApiModelProperty(value = "计费çç¥è¯¦æ
å表") |
| | | @NotNull(message = "å°å³°å¹³è°·æ¶é´æ®µä¸è½ä¸ºç©º!") |
| | | private List<ElectricityTypeSettingItemAddVO> ruleDetailList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.Max; |
| | | import javax.validation.constraints.Min; |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * ä»·æ ¼å¯¹è±¡ rule_details |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "计费è§åè´¹ç¨ç±»ååæ¶é´æ®µæ°å¢è¯·æ±ç±»") |
| | | public class ElectricityTypeSettingItemAddVO { |
| | | |
| | | /** |
| | | * è´¹ç¨ç±»åæ¶é´æ®µ |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»åæ¶é´æ®µ") |
| | | @NotNull(message = "è´¹ç¨ç±»åæ¶é´æ®µä¸è½ä¸ºç©º!") |
| | | @Min(value = 1, message = "è´¹ç¨ç±»åæ¶é´æ®µæå°å¼ä¸º1") |
| | | @Max(value = 48, message = "è´¹ç¨ç±»åæ¶é´æ®µæå¤§å¼ä¸º48") |
| | | private Integer timePeriod; |
| | | |
| | | /** |
| | | * æ¶é´æ®µç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷 |
| | | */ |
| | | @ApiModelProperty(value = "æ¶é´æ®µç±»å") |
| | | @NotNull(message = "æ¶é´æ®µç±»åä¸è½ä¸ºç©º!") |
| | | private String type; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.dto; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | /** |
| | | * ä»·æ ¼å¯¹è±¡ rule_details |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "计费è§åè´¹ç¨ç±»ååæ¶é´æ®µæ´æ°è¯·æ±ç±»") |
| | | public class ElectricityTypeSettingItemUpdateVO { |
| | | |
| | | /** |
| | | * 计费è§åå表id |
| | | */ |
| | | @ApiModelProperty(value = "计费è§åå表id") |
| | | @NotNull(message = "计费è§åå表idä¸è½ä¸ºç©º!") |
| | | private String id; |
| | | |
| | | /** |
| | | * çµè´¹ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷 |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»å") |
| | | @NotNull(message = "è´¹ç¨ç±»åä¸è½ä¸ºç©º!") |
| | | private String type; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.validation.constraints.DecimalMin; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计费è§å对象 rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-19 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "计费è§åæ´æ°è¯·æ±å®ä½ç±»") |
| | | public class ElectricityTypeSettingUpdateVO { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @NotNull(message = "idä¸è½ä¸ºç©º!") |
| | | @ApiModelProperty(value = "计费è§åid") |
| | | private String id; |
| | | |
| | | /** |
| | | * è§ååç§° |
| | | */ |
| | | @NotBlank(message = "è§ååç§°ä¸è½ä¸ºç©º!") |
| | | @ApiModelProperty(value = "è§ååç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * çææ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "çææ¶é´") |
| | | @NotBlank(message = "çææ¶é´ä¸è½ä¸ºç©º!") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern = "yyyy-MM-dd") |
| | | private Date effectiveDate; |
| | | |
| | | /** |
| | | * å°æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å°æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "å°æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "å°æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal sharpFee; |
| | | |
| | | /** |
| | | * å³°æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å³°æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "å³°æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "å³°æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal peakFee; |
| | | |
| | | /** |
| | | * å¹³æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¹³æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "å¹³æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "å¹³æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal flatFee; |
| | | |
| | | /** |
| | | * è°·æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "è°·æ¶æ®µçµè´¹ä»·æ ¼") |
| | | @NotNull(message = "è°·æ¶æ®µçµè´¹ä»·æ ¼ä¸è½ä¸ºç©º!") |
| | | @DecimalMin(value = "0", message = "è°·æ¶æ®µçµè´¹ä»·æ ¼æå°ä¸º0") |
| | | private BigDecimal valleyFee; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 计费çç¥è¯¦æ
å表 |
| | | */ |
| | | @ApiModelProperty(value = "计费çç¥è¯¦æ
å表") |
| | | @NotNull(message = "å°å³°å¹³è°·æ¶é´æ®µä¸è½ä¸ºç©º!") |
| | | private List<ElectricityTypeSettingItemUpdateVO> ruleDetailList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.entity; |
| | | |
| | | import com.dingzhuo.energy.framework.aspectj.lang.annotation.Excel; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å°å³°å¹³è°·æ°æ®è¡¨ |
| | | * |
| | | * @author sys |
| | | * @date 2024-08-27 |
| | | */ |
| | | @Data |
| | | public class ElectricityDataItem { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ç¹ä½id |
| | | */ |
| | | @Excel(name = "ç¹ä½id") |
| | | private String indexId; |
| | | |
| | | /** |
| | | * æ¶é´ç¼å· |
| | | */ |
| | | @Excel(name = "æ¶é´ç¼å·") |
| | | private String timeCode; |
| | | |
| | | /** |
| | | * æ¶é´ç±»å |
| | | */ |
| | | @Excel(name = "æ¶é´ç±»å") |
| | | private String timeType; |
| | | |
| | | /** |
| | | * ç¨çµç±»åå³°ãå¹³ãè°·ç |
| | | */ |
| | | @Excel(name = "ç¨çµç±»åå³°ãå¹³ãè°·ç") |
| | | private String electricityType; |
| | | |
| | | /** |
| | | * ææ ç¼ç ï¼åä½å段ï¼å¯ä»¥ç¨ code æ¥è¯¢ |
| | | */ |
| | | @Excel(name = "ææ ç¼ç ï¼åä½å段ï¼å¯ä»¥ç¨ code æ¥è¯¢") |
| | | private String indexCode; |
| | | |
| | | /** |
| | | * æ°æ®æ¶é´ |
| | | */ |
| | | @Excel(name = "æ°æ®æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date dataTime; |
| | | |
| | | /** |
| | | * å¼å§æ¶é´ |
| | | */ |
| | | @Excel(name = "å¼å§æ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date beginTime; |
| | | |
| | | /** |
| | | * ç»ææ¶é´ |
| | | */ |
| | | @Excel(name = "ç»ææ¶é´", width = 30, dateFormat = "yyyy-MM-dd") |
| | | private Date endTime; |
| | | |
| | | /** |
| | | * ç¨çµé |
| | | */ |
| | | @Excel(name = "ç¨çµé") |
| | | private BigDecimal electricity; |
| | | |
| | | /** |
| | | * çµè´¹ |
| | | */ |
| | | @Excel(name = "çµè´¹") |
| | | private BigDecimal cost; |
| | | |
| | | /** |
| | | * åä»· |
| | | */ |
| | | @Excel(name = "åä»·") |
| | | private BigDecimal price; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * æ´æ°æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date updateTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.entity; |
| | | |
| | | import com.dingzhuo.energy.framework.aspectj.lang.annotation.Excel; |
| | | import com.dingzhuo.energy.framework.web.domain.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 计费è§å对象 rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | @Data |
| | | public class ElectricityTypeSetting extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * $column.columnComment |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * è§ååç§° |
| | | */ |
| | | @Excel(name = "è§ååç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * çææ¶é´ |
| | | */ |
| | | @Excel(name = "çææ¶é´") |
| | | private Date effectiveDate; |
| | | |
| | | /** |
| | | * å°çµè´¹ä»·æ ¼ |
| | | */ |
| | | @Excel(name = "å°çµè´¹ä»·æ ¼") |
| | | private BigDecimal sharpFee; |
| | | |
| | | /** |
| | | * å³°çµè´¹ä»·æ ¼ |
| | | */ |
| | | @Excel(name = "å³°çµè´¹ä»·æ ¼") |
| | | private BigDecimal peakFee; |
| | | |
| | | /** |
| | | * å¹³çµè´¹ä»·æ ¼ |
| | | */ |
| | | @Excel(name = "å¹³çµè´¹ä»·æ ¼") |
| | | private BigDecimal flatFee; |
| | | |
| | | /** |
| | | * è°·çµè´¹ä»·æ ¼ |
| | | */ |
| | | @Excel(name = "è°·çµè´¹ä»·æ ¼") |
| | | private BigDecimal valleyFee; |
| | | |
| | | /** |
| | | * ç»ç»æ¶æid |
| | | */ |
| | | @Excel(name = "ç»ç»æ¶æid") |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * '0'å 餿 å¿ï¼0代表åå¨ 2代表å é¤ï¼ |
| | | */ |
| | | private String delFlag; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.entity; |
| | | |
| | | import com.dingzhuo.energy.framework.aspectj.lang.annotation.Excel; |
| | | import com.dingzhuo.energy.framework.web.domain.BaseEntity; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * ä»·æ ¼å¯¹è±¡ rule_details |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | @Data |
| | | public class ElectricityTypeSettingItem extends BaseEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * $column.columnComment |
| | | */ |
| | | private String id; |
| | | |
| | | /** |
| | | * 计费è§åid |
| | | */ |
| | | @Excel(name = "计费è§åid") |
| | | private String ruleId; |
| | | |
| | | /** |
| | | * è´¹ç¨ç±»åæ¶é´æ®µ |
| | | */ |
| | | @Excel(name = "è´¹ç¨ç±»åæ¶é´æ®µ", readConverterExp = "1=0:00") |
| | | private Integer timePeriod; |
| | | |
| | | /** |
| | | * çµè´¹ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷 |
| | | */ |
| | | @Excel(name = "çµè´¹ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷") |
| | | private String type; |
| | | |
| | | /** |
| | | * ç»ç»æ¶æid |
| | | */ |
| | | @Excel(name = "ç»ç»æ¶æid") |
| | | private Long deptId; |
| | | |
| | | /** |
| | | * å 餿 è®°ï¼é»è®¤0ï¼æªå é¤ï¼2 å é¤ |
| | | */ |
| | | private String delFlag; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.enums; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Getter; |
| | | |
| | | @Getter |
| | | @AllArgsConstructor |
| | | public enum ElectricityTypeEnum { |
| | | SHARP("å°"), |
| | | PEAK("å³°"), |
| | | FLAT("å¹³"), |
| | | VALLEY("è°·"); |
| | | |
| | | private final String desc; |
| | | |
| | | public static String getNameByType(String type) { |
| | | for (ElectricityTypeEnum electricityType : ElectricityTypeEnum.values()) { |
| | | if (electricityType.name().equalsIgnoreCase(type)) { |
| | | return electricityType.name(); |
| | | } |
| | | } |
| | | throw new IllegalArgumentException("Invalid electricity type: " + type); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | @Data |
| | | @ApiModel(value = "计费è§ååæ¶æ®µçè´¹ç¨è¿åå®ä½") |
| | | public class ElectricityPeriodFeeDetailVO { |
| | | |
| | | /** |
| | | * è´¹ç¨ç±»åæ¶é´æ®µ |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»åæ¶é´æ®µ") |
| | | private Integer timePeriod; |
| | | |
| | | /** |
| | | * çµè´¹ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷 |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷") |
| | | private Integer type; |
| | | |
| | | /** |
| | | * çµè´¹ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷 |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»åæè¿°") |
| | | private String typeDesc; |
| | | |
| | | /** |
| | | * çµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "çµè´¹ä»·æ ¼") |
| | | private BigDecimal electricityFee; |
| | | |
| | | /** |
| | | * æå¡è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "æå¡è´¹ä»·æ ¼") |
| | | private BigDecimal serviceFee; |
| | | |
| | | /** |
| | | * åè½¦è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "åè½¦è´¹ä»·æ ¼") |
| | | private BigDecimal parkingFee; |
| | | |
| | | /** |
| | | * è¶
æ¶å ç¨è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "è¶
æ¶å ç¨è´¹ä»·æ ¼") |
| | | private BigDecimal occupancyFee; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计费è§å对象 rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-19 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "计费è§å详æ
æ¥è¯¢è¿åå®ä½ç±»") |
| | | public class ElectricityTypeSettingItemQueryVO { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "计费è§åid") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private String id; |
| | | |
| | | /** |
| | | * è§ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "è§ååç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * çææ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "çææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date effectiveDate; |
| | | |
| | | /** |
| | | * å°æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å°æ¶æ®µçµè´¹ä»·æ ¼") |
| | | private BigDecimal sharpFee; |
| | | |
| | | /** |
| | | * å³°æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å³°æ¶æ®µçµè´¹ä»·æ ¼") |
| | | private BigDecimal peakFee; |
| | | |
| | | /** |
| | | * å¹³æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¹³æ¶æ®µçµè´¹ä»·æ ¼") |
| | | private BigDecimal flatFee; |
| | | |
| | | /** |
| | | * è°·æ¶æ®µçµè´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "è°·æ¶æ®µçµè´¹ä»·æ ¼") |
| | | private BigDecimal valleyFee; |
| | | |
| | | /** |
| | | * å°æ¶æ®µæå¡è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å°æ¶æ®µæå¡è´¹ä»·æ ¼") |
| | | private BigDecimal sharpServiceFee; |
| | | |
| | | /** |
| | | * å³°æ¶æ®µæå¡è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å³°æ¶æ®µæå¡è´¹ä»·æ ¼") |
| | | private BigDecimal peakServiceFee; |
| | | |
| | | /** |
| | | * å¹³æ¶æ®µæå¡è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¹³æ¶æ®µæå¡è´¹ä»·æ ¼") |
| | | private BigDecimal flatServiceFee; |
| | | |
| | | /** |
| | | * è°·æ¶æ®µæå¡è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "è°·æ¶æ®µæå¡è´¹ä»·æ ¼") |
| | | private BigDecimal valleyServiceFee; |
| | | |
| | | /** |
| | | * å°æ¶æ®µåè½¦è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å°æ¶æ®µåè½¦è´¹ä»·æ ¼") |
| | | private BigDecimal sharpParkingFee; |
| | | |
| | | /** |
| | | * å³°æ¶æ®µåè½¦è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å³°æ¶æ®µåè½¦è´¹ä»·æ ¼") |
| | | private BigDecimal peakParkingFee; |
| | | |
| | | /** |
| | | * å¹³æ¶æ®µåè½¦è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¹³æ¶æ®µåè½¦è´¹ä»·æ ¼") |
| | | private BigDecimal flatParkingFee; |
| | | |
| | | /** |
| | | * è°·æ¶æ®µåè½¦è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "è°·æ¶æ®µåè½¦è´¹ä»·æ ¼") |
| | | private BigDecimal valleyParkingFee; |
| | | |
| | | /** |
| | | * å°æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å°æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼") |
| | | private BigDecimal sharpOccupancyFee; |
| | | |
| | | /** |
| | | * å³°æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å³°æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼") |
| | | private BigDecimal peakOccupancyFee; |
| | | |
| | | /** |
| | | * å¹³æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "å¹³æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼") |
| | | private BigDecimal flatOccupancyFee; |
| | | |
| | | /** |
| | | * è°·æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼ |
| | | */ |
| | | @ApiModelProperty(value = "è°·æ¶æ®µè¶
æ¶å ç¨è´¹ä»·æ ¼") |
| | | private BigDecimal valleyOccupancyFee; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | |
| | | /** |
| | | * 计费çç¥è¯¦æ
å表 |
| | | */ |
| | | @ApiModelProperty(value = "计费çç¥æ¶é´æ®µè¯¦æ
å表") |
| | | private List<ElectricityTypeSettingItemVO> ruleDetailList; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * ä»·æ ¼å¯¹è±¡ rule_details |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "计费è§å详æ
æ¥è¯¢è¿åæ¶é´æ®µå®ä½ç±»") |
| | | public class ElectricityTypeSettingItemVO { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "计费è§åå表id") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long id; |
| | | |
| | | /** |
| | | * 计费è§åid |
| | | */ |
| | | @ApiModelProperty(value = "计费è§åid") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long ruleId; |
| | | |
| | | /** |
| | | * è´¹ç¨ç±»åæ¶é´æ®µ |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»åæ¶é´æ®µ") |
| | | private Integer timePeriod; |
| | | |
| | | /** |
| | | * çµè´¹ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷 |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷") |
| | | private String type; |
| | | |
| | | /** |
| | | * çµè´¹ç±»å 0:å° 1:å³° 2:å¹³ 3:è°· 4:深谷 |
| | | */ |
| | | @ApiModelProperty(value = "è´¹ç¨ç±»åæè¿°") |
| | | private String typeDesc; |
| | | |
| | | /** |
| | | * ç»ç»æ¶æid |
| | | */ |
| | | @ApiModelProperty(value = "ç»ç»æ¶æid") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private Long deptId; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
| | | import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 计费è§å对象 rules |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-19 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "计费è§åå页æ¥è¯¢è¿åå®ä½ç±»") |
| | | public class ElectricityTypeSettingPageListVO { |
| | | |
| | | /** |
| | | * ä¸»é® |
| | | */ |
| | | @ApiModelProperty(value = "计费è§åid") |
| | | @JsonSerialize(using = ToStringSerializer.class) |
| | | private String id; |
| | | |
| | | /** |
| | | * è§ååç§° |
| | | */ |
| | | @ApiModelProperty(value = "è§ååç§°") |
| | | private String name; |
| | | |
| | | /** |
| | | * æ¯å¦çæ |
| | | */ |
| | | @ApiModelProperty(value = "æ¯å¦çæ") |
| | | private boolean isEffective; |
| | | |
| | | /** |
| | | * çææ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "çææ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date effectiveDate; |
| | | |
| | | /** |
| | | * å建è
|
| | | */ |
| | | @ApiModelProperty(value = "å建è
") |
| | | private String createBy; |
| | | |
| | | /** |
| | | * å建æ¶é´ |
| | | */ |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date createTime; |
| | | |
| | | /** |
| | | * 夿³¨ |
| | | */ |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.domain.vo; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * å°å³°å¹³è°·æ¥è¡¨ vo |
| | | */ |
| | | @Data |
| | | @NoArgsConstructor |
| | | @ApiModel(value = "å°å³°å¹³è°·æ¥è¡¨ vo", description = "å°å³°å¹³è°·æ¥è¡¨ vo") |
| | | public class PeakAndValleyReportVO { |
| | | |
| | | /** |
| | | * æ¶é´ |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | @ApiModelProperty(value = "æ¶é´") |
| | | private Date time; |
| | | |
| | | /** |
| | | * å°è´¹ç¨ |
| | | */ |
| | | @ApiModelProperty(value = "å°è´¹ç¨") |
| | | private BigDecimal sharpFee; |
| | | |
| | | /** |
| | | * å°çµé |
| | | */ |
| | | @ApiModelProperty(value = "å°çµé") |
| | | private BigDecimal sharpPower; |
| | | |
| | | /** |
| | | * å³°è´¹ç¨ |
| | | */ |
| | | @ApiModelProperty(value = "å³°è´¹ç¨") |
| | | private BigDecimal peakFee; |
| | | |
| | | /** |
| | | * å³°çµé |
| | | */ |
| | | @ApiModelProperty(value = "å³°çµé") |
| | | private BigDecimal peakPower; |
| | | |
| | | /** |
| | | * å¹³è´¹ç¨ |
| | | */ |
| | | @ApiModelProperty(value = "平费ç¨") |
| | | private BigDecimal flatFee; |
| | | |
| | | /** |
| | | * å¹³çµé |
| | | */ |
| | | @ApiModelProperty(value = "å¹³çµé") |
| | | private BigDecimal flatPower; |
| | | |
| | | /** |
| | | * è°·è´¹ç¨ |
| | | */ |
| | | @ApiModelProperty(value = "è°·è´¹ç¨") |
| | | private BigDecimal valleyFee; |
| | | |
| | | /** |
| | | * è°·çµé |
| | | */ |
| | | @ApiModelProperty(value = "è°·çµé") |
| | | private BigDecimal valleyPower; |
| | | |
| | | |
| | | public PeakAndValleyReportVO(Date time, BigDecimal sharpFee, BigDecimal sharpPower, BigDecimal peakFee, |
| | | BigDecimal peakPower, BigDecimal flatFee, BigDecimal flatPower, BigDecimal valleyFee, |
| | | BigDecimal valleyPower) { |
| | | this.time = time; |
| | | this.sharpFee = sharpFee; |
| | | this.sharpPower = sharpPower; |
| | | this.peakFee = peakFee; |
| | | this.peakPower = peakPower; |
| | | this.flatFee = flatFee; |
| | | this.flatPower = flatPower; |
| | | this.valleyFee = valleyFee; |
| | | this.valleyPower = valleyPower; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.mapper; |
| | | |
| | | |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityDataItem; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | |
| | | /** |
| | | * å°å³°å¹³è°·æ°æ®å¯¹è±¡ Mapperæ¥å£ |
| | | * |
| | | * @author sys |
| | | * @date 2024-08-27 |
| | | */ |
| | | public interface ElectricityDataItemMapper { |
| | | |
| | | /** |
| | | * æ¥è¯¢å°å³°å¹³è°·ç»è®¡æ°æ® |
| | | * |
| | | * @param indexIdSet ç¹ä½idéå |
| | | * @param startTime å¼å§æ¶é´ |
| | | * @param endTime æªæ¢æ¶é´ |
| | | * @param timeType æ¶é´ç±»å |
| | | * @return ç»æ |
| | | */ |
| | | List<ElectricityDataItem> getDataStatistics(@Param("indexIdSet") Set<String> indexIdSet, @Param("startTime") Date startTime, |
| | | @Param("endTime") Date endTime, @Param("timeType") String timeType); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.mapper; |
| | | |
| | | |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityTypeSettingItem; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ä»·æ ¼Mapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | public interface ElectricityTypeSettingItemMapper { |
| | | |
| | | /** |
| | | * æ ¹æ®è§åidæ¥è¯¢è§å详æ
|
| | | * |
| | | * @param id è§åid |
| | | * @return ç»æ |
| | | */ |
| | | List<ElectricityTypeSettingItem> selectListByRuleId(String id); |
| | | |
| | | /** |
| | | * ä¿®æ¹ |
| | | * |
| | | * @param ruleDetails è§å详æ
|
| | | */ |
| | | int updateRuleDetails(ElectricityTypeSettingItem ruleDetails); |
| | | |
| | | /** |
| | | * æ°å¢è§åæç» |
| | | * |
| | | * @param ruleDetails è§åæç» |
| | | * @return ç»æ |
| | | */ |
| | | int insertRuleDetails(ElectricityTypeSettingItem ruleDetails); |
| | | |
| | | /** |
| | | * æ ¹æ®è§åidå é¤è§åæç» |
| | | * |
| | | * @param ruleId è§åid |
| | | */ |
| | | int deleteRulesByRuleId(String ruleId); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.mapper; |
| | | |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityTypeSetting; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingPageListVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计费è§åMapperæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | public interface ElectricityTypeSettingMapper { |
| | | |
| | | /** |
| | | * æ¥è¯¢å表 |
| | | */ |
| | | List<ElectricityTypeSettingPageListVO> selectList(String name); |
| | | |
| | | /** |
| | | * æ ¹æ®idæ¥è¯¢è¯¦æ
|
| | | * |
| | | * @param id id |
| | | * @return ç»æ |
| | | */ |
| | | ElectricityTypeSetting selectById(String id); |
| | | |
| | | /** |
| | | * æ´æ° |
| | | * |
| | | * @param rules è§åä¿¡æ¯ |
| | | * @return ç»æ |
| | | */ |
| | | int updateRules(ElectricityTypeSetting rules); |
| | | |
| | | /** |
| | | * æ°å¢è§å |
| | | * |
| | | * @param rules è§å |
| | | * @return ç»æ |
| | | */ |
| | | int insertRules(ElectricityTypeSetting rules); |
| | | |
| | | /** |
| | | * å é¤è®¡è´¹è§å |
| | | * |
| | | * @param id id |
| | | * @return ç»æ |
| | | */ |
| | | int deleteRulesById(String id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.service; |
| | | |
| | | |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityDataItemListDTO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.PeakAndValleyReportVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * å°å³°å¹³è°·æ°æ®Serviceæ¥å£ |
| | | * |
| | | * @author sys |
| | | * @date 2024-08-27 |
| | | */ |
| | | public interface IElectricityDataItemService { |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»è®¡æ°æ® |
| | | * |
| | | * @param dto 请æ±åæ° |
| | | * @return ç»æ |
| | | */ |
| | | List<PeakAndValleyReportVO> getDataStatistics(ElectricityDataItemListDTO dto); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.service; |
| | | |
| | | |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingAddVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingUpdateVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingItemQueryVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingPageListVO; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 计费è§åServiceæ¥å£ |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | public interface IElectricityTypeSettingService { |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¡è´¹è§åå表 |
| | | */ |
| | | List<ElectricityTypeSettingPageListVO> selectPageList(String name); |
| | | |
| | | /** |
| | | * è·å计费è§å详æ
|
| | | */ |
| | | ElectricityTypeSettingItemQueryVO getRuleDetail(String id); |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¡è´¹çç¥ |
| | | */ |
| | | void updateRule(ElectricityTypeSettingUpdateVO request); |
| | | |
| | | /** |
| | | * æ°å¢è®¡è´¹çç¥ |
| | | */ |
| | | void addRule(ElectricityTypeSettingAddVO request); |
| | | |
| | | /** |
| | | * å é¤è®¡è´¹çç¥ |
| | | */ |
| | | void delRule(String id); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.service.impl; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.dingzhuo.energy.common.utils.time.TimeType; |
| | | import com.dingzhuo.energy.data.model.domain.vo.ModelNodeIndexInfor; |
| | | import com.dingzhuo.energy.data.model.mapper.ModelNodeMapper; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityDataItemListDTO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityDataItem; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.enums.ElectricityTypeEnum; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.PeakAndValleyReportVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.mapper.ElectricityDataItemMapper; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.service.IElectricityDataItemService; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * å°å³°å¹³è°·æ°æ®Serviceä¸å¡å±å¤ç |
| | | * |
| | | * @author sys |
| | | * @date 2024-08-27 |
| | | */ |
| | | @Service |
| | | public class ElectricityDataItemServiceImpl implements IElectricityDataItemService { |
| | | @Resource |
| | | private ModelNodeMapper modelNodeMapper; |
| | | @Resource |
| | | private ElectricityDataItemMapper electricityDataItemMapper; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢ç»è®¡æ°æ® |
| | | * |
| | | * @param dto 请æ±åæ° |
| | | * @return ç»æ |
| | | */ |
| | | @Override |
| | | public List<PeakAndValleyReportVO> getDataStatistics(ElectricityDataItemListDTO dto) { |
| | | List<PeakAndValleyReportVO> reportVOList = new ArrayList<>(); |
| | | // æ¥è¯¢æ¶é´èå´ |
| | | Date startTime = DateUtil.beginOfMonth(dto.getQueryTime()); |
| | | Date endTime = DateUtil.endOfMonth(startTime); |
| | | String timeType = dto.getTimeType(); |
| | | |
| | | Map<String, List<ElectricityDataItem>> electricityDataMap = new HashMap<>(); |
| | | // æ¥è¯¢ç¹ä½ä¿¡æ¯ |
| | | List<ModelNodeIndexInfor> nodeIndexInfoList = modelNodeMapper.selectIndexByModelCodeAndNodeId(dto.getModelCode(), dto.getNodeId()); |
| | | if (CollectionUtils.isNotEmpty(nodeIndexInfoList)) { |
| | | Set<String> indexSet = nodeIndexInfoList.stream().map(ModelNodeIndexInfor::getIndexId).collect(Collectors.toSet()); |
| | | List<ElectricityDataItem> dataItemList = electricityDataItemMapper.getDataStatistics(indexSet, startTime, endTime, timeType); |
| | | |
| | | electricityDataMap = dataItemList.stream() |
| | | .collect(Collectors.groupingBy(li -> DateUtil.formatDateTime(li.getDataTime()))); |
| | | } |
| | | while (!startTime.after(endTime)) { |
| | | String mapKey = DateUtil.formatDateTime(startTime); |
| | | List<ElectricityDataItem> dataItemList = electricityDataMap.get(mapKey); |
| | | |
| | | BigDecimal sharpFee = BigDecimal.ZERO; |
| | | BigDecimal sharpPower = BigDecimal.ZERO; |
| | | BigDecimal peakFee = BigDecimal.ZERO; |
| | | BigDecimal peakPower = BigDecimal.ZERO; |
| | | BigDecimal flatFee = BigDecimal.ZERO; |
| | | BigDecimal flatPower = BigDecimal.ZERO; |
| | | BigDecimal valleyFee = BigDecimal.ZERO; |
| | | BigDecimal valleyPower = BigDecimal.ZERO; |
| | | |
| | | if (CollectionUtils.isNotEmpty(dataItemList)) { |
| | | for (ElectricityDataItem electricityDataItem : dataItemList) { |
| | | String electricityType = electricityDataItem.getElectricityType(); |
| | | |
| | | if (ElectricityTypeEnum.SHARP.name().equals(electricityType)) { |
| | | sharpFee = sharpFee.add(electricityDataItem.getCost()); |
| | | sharpPower = sharpPower.add(electricityDataItem.getElectricity()); |
| | | } else if (ElectricityTypeEnum.PEAK.name().equals(electricityType)) { |
| | | peakFee = peakFee.add(electricityDataItem.getCost()); |
| | | peakPower = peakPower.add(electricityDataItem.getElectricity()); |
| | | } else if (ElectricityTypeEnum.FLAT.name().equals(electricityType)) { |
| | | flatFee = flatFee.add(electricityDataItem.getCost()); |
| | | flatPower = flatPower.add(electricityDataItem.getElectricity()); |
| | | } else { |
| | | valleyFee = valleyFee.add(electricityDataItem.getCost()); |
| | | valleyPower = valleyPower.add(electricityDataItem.getElectricity()); |
| | | } |
| | | } |
| | | } |
| | | PeakAndValleyReportVO peakAndValleyReportVO = new PeakAndValleyReportVO(startTime, sharpFee, sharpPower, |
| | | peakFee, peakPower, flatFee, flatPower, valleyFee, valleyPower); |
| | | |
| | | reportVOList.add(peakAndValleyReportVO); |
| | | switch (TimeType.valueOf(timeType)) { |
| | | case HOUR: |
| | | startTime = DateUtil.offsetHour(startTime, 1); |
| | | break; |
| | | case DAY: |
| | | startTime = DateUtil.offsetDay(startTime, 1); |
| | | break; |
| | | case MONTH: |
| | | startTime = DateUtil.offsetMonth(startTime, 1); |
| | | break; |
| | | default: |
| | | startTime = DateUtil.offsetMonth(startTime, 12); |
| | | break; |
| | | } |
| | | } |
| | | |
| | | return reportVOList; |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.dingzhuo.energy.project.electricityTypeSetting.service.impl; |
| | | |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingAddVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingItemAddVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingItemUpdateVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.dto.ElectricityTypeSettingUpdateVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityTypeSetting; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityTypeSettingItem; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.enums.ElectricityTypeEnum; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingItemQueryVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingItemVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingPageListVO; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.mapper.ElectricityTypeSettingItemMapper; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.mapper.ElectricityTypeSettingMapper; |
| | | import com.dingzhuo.energy.project.electricityTypeSetting.service.IElectricityTypeSettingService; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.UUID; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 计费è§åServiceä¸å¡å±å¤ç |
| | | * |
| | | * @author ruoyi |
| | | * @date 2024-06-14 |
| | | */ |
| | | @Service |
| | | public class ElectricityTypeSettingServiceImpl implements IElectricityTypeSettingService { |
| | | |
| | | @Resource |
| | | private ElectricityTypeSettingMapper rulesMapper; |
| | | @Resource |
| | | private ElectricityTypeSettingItemMapper ruleDetailsMapper; |
| | | |
| | | |
| | | /** |
| | | * æ¥è¯¢è®¡è´¹è§åå表 |
| | | */ |
| | | @Override |
| | | public List<ElectricityTypeSettingPageListVO> selectPageList(String name) { |
| | | List<ElectricityTypeSettingPageListVO> rulesPageListVOList = rulesMapper.selectList(name); |
| | | if (CollectionUtils.isEmpty(rulesPageListVOList)) { |
| | | return rulesPageListVOList; |
| | | } |
| | | Date maxEffectiveDate = new Date(); |
| | | Date date = new Date(); |
| | | |
| | | for (ElectricityTypeSettingPageListVO vo : rulesPageListVOList) { |
| | | Date effectiveDate = vo.getEffectiveDate(); |
| | | // å¤æå¹¶è®¾ç½® effective 屿§ |
| | | if (effectiveDate.before(date) && effectiveDate.after(maxEffectiveDate)) { |
| | | maxEffectiveDate = effectiveDate; |
| | | vo.setEffective(true); |
| | | } |
| | | } |
| | | return rulesPageListVOList; |
| | | } |
| | | |
| | | /** |
| | | * è·å计费è§å详æ
|
| | | */ |
| | | @Override |
| | | public ElectricityTypeSettingItemQueryVO getRuleDetail(String id) { |
| | | ElectricityTypeSettingItemQueryVO rulesDetailQueryResponse = new ElectricityTypeSettingItemQueryVO(); |
| | | |
| | | ElectricityTypeSetting rules = rulesMapper.selectById(id); |
| | | if (ObjectUtils.isEmpty(rules)) { |
| | | return rulesDetailQueryResponse; |
| | | } |
| | | BeanUtils.copyProperties(rules, rulesDetailQueryResponse); |
| | | |
| | | List<ElectricityTypeSettingItem> detailsList = ruleDetailsMapper.selectListByRuleId(id); |
| | | if (ObjectUtils.isNotEmpty(detailsList)) { |
| | | List<ElectricityTypeSettingItemVO> ruleDetailList = new ArrayList<>(); |
| | | for (ElectricityTypeSettingItem ruleDetails : detailsList) { |
| | | ElectricityTypeSettingItemVO ruleDetailsResponse = new ElectricityTypeSettingItemVO(); |
| | | BeanUtils.copyProperties(ruleDetails, ruleDetailsResponse); |
| | | ruleDetailsResponse.setTypeDesc(ElectricityTypeEnum.getNameByType(ruleDetails.getType())); |
| | | ruleDetailList.add(ruleDetailsResponse); |
| | | } |
| | | rulesDetailQueryResponse.setRuleDetailList(ruleDetailList); |
| | | } |
| | | return rulesDetailQueryResponse; |
| | | } |
| | | |
| | | /** |
| | | * ä¿®æ¹è®¡è´¹çç¥ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateRule(ElectricityTypeSettingUpdateVO request) { |
| | | ElectricityTypeSetting rules = rulesMapper.selectById(request.getId()); |
| | | if (ObjectUtils.isEmpty(rules)) { |
| | | throw new RuntimeException("计费è§åä¸åå¨"); |
| | | } |
| | | |
| | | // 夿å½åçææ¶é´ä¸è½å°äºå½åæ¥æ |
| | | Date now = new Date(); |
| | | Date inputDate = request.getEffectiveDate(); |
| | | if (inputDate.before(now) || inputDate.equals(now)) { |
| | | throw new RuntimeException("ä¼ å
¥æ¶é´æ©äºæçäºå½åæ¶é´: " + inputDate); |
| | | } |
| | | |
| | | List<ElectricityTypeSettingItemUpdateVO> ruleDetailList = request.getRuleDetailList(); |
| | | |
| | | if (ruleDetailList.size() != 48) { |
| | | throw new RuntimeException("æ¶è´¹æ¶é´æ®µå¿
é¡»æ¯48æ¡"); |
| | | } |
| | | |
| | | BeanUtils.copyProperties(request, rules); |
| | | rulesMapper.updateRules(rules); |
| | | |
| | | for (ElectricityTypeSettingItemUpdateVO ruleDetailsRequest : ruleDetailList) { |
| | | ElectricityTypeSettingItem ruleDetails = new ElectricityTypeSettingItem(); |
| | | |
| | | ruleDetails.setId(ruleDetailsRequest.getId()); |
| | | ruleDetails.setType(ruleDetailsRequest.getType()); |
| | | if (ObjectUtils.isNotEmpty(ruleDetailsRequest.getRemark())) { |
| | | ruleDetails.setRemark(ruleDetailsRequest.getRemark()); |
| | | } |
| | | ruleDetailsMapper.updateRuleDetails(ruleDetails); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ°å¢è®¡è´¹çç¥ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addRule(ElectricityTypeSettingAddVO request) { |
| | | Date effectiveDate = request.getEffectiveDate(); |
| | | Date now = new Date(); |
| | | if (effectiveDate.before(now) || effectiveDate.equals(now)) { |
| | | throw new RuntimeException("ä¼ å
¥æ¶é´æ©äºæçäºå½åæ¶é´"); |
| | | } |
| | | |
| | | List<ElectricityTypeSettingItemAddVO> ruleDetailList = request.getRuleDetailList(); |
| | | |
| | | if (ruleDetailList.size() != 48) { |
| | | throw new RuntimeException("æ¶è´¹æ¶é´æ®µå¿
é¡»æ¯48æ¡!"); |
| | | } |
| | | List<Integer> timePeriodList = ruleDetailList.stream().distinct().map(ElectricityTypeSettingItemAddVO::getTimePeriod).collect(Collectors.toList()); |
| | | if (timePeriodList.size() != ruleDetailList.size()) { |
| | | throw new RuntimeException("æ¶è´¹æ¶é´æ®µä¸è½éå¤!"); |
| | | } |
| | | Date createTime = new Date(); |
| | | |
| | | ElectricityTypeSetting rules = new ElectricityTypeSetting(); |
| | | BeanUtils.copyProperties(request, rules); |
| | | rules.setId(UUID.randomUUID().toString()); |
| | | rules.setCreateTime(createTime); |
| | | rulesMapper.insertRules(rules); |
| | | |
| | | for (ElectricityTypeSettingItemAddVO ruleDetailsAddRequest : ruleDetailList) { |
| | | ElectricityTypeSettingItem ruleDetails = new ElectricityTypeSettingItem(); |
| | | ruleDetails.setRuleId(rules.getId()); |
| | | BeanUtils.copyProperties(ruleDetailsAddRequest, ruleDetails); |
| | | ruleDetails.setId(UUID.randomUUID().toString()); |
| | | ruleDetails.setCreateTime(createTime); |
| | | ruleDetailsMapper.insertRuleDetails(ruleDetails); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * å é¤è®¡è´¹çç¥ |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void delRule(String id) { |
| | | ElectricityTypeSetting rules = rulesMapper.selectById(id); |
| | | if (ObjectUtils.isEmpty(rules)) { |
| | | throw new RuntimeException("计费è§åä¸åå¨"); |
| | | } |
| | | |
| | | rulesMapper.deleteRulesById(id); |
| | | ruleDetailsMapper.deleteRulesByRuleId(id); |
| | | } |
| | | } |
| | |
| | | # 项ç®ç¸å
³é
ç½® |
| | | ruoyi: |
| | | # åç§° |
| | | name: ä¸ä¸½å»ç |
| | | name: æºç¢³æªæ¥EMS |
| | | # çæ¬ |
| | | version: 1.0.0 |
| | | # çæå¹´ä»½ |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.dingzhuo.energy.project.electricityTypeSetting.mapper.ElectricityDataItemMapper"> |
| | | |
| | | |
| | | <select id="getDataStatistics" |
| | | resultType="com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityDataItem"> |
| | | SELECT |
| | | index_code indexCode, |
| | | time_code timeCode, |
| | | electricity_type electricityType, |
| | | data_time dataTime, |
| | | electricity, |
| | | "cost", |
| | | time_type timeType, |
| | | price, |
| | | remark |
| | | FROM |
| | | "electricity_data_item" |
| | | WHERE |
| | | index_id IN |
| | | <foreach collection="indexIdSet" item="indexId" open="(" separator="," close=")"> |
| | | #{indexId} |
| | | </foreach> |
| | | AND (data_time BETWEEN #{startTime} AND #{endTime}) |
| | | AND time_type = #{timeType} |
| | | </select> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.dingzhuo.energy.project.electricityTypeSetting.mapper.ElectricityTypeSettingItemMapper"> |
| | | |
| | | <sql id="selectRuleDetailsVo"> |
| | | select id, |
| | | rule_id, |
| | | start_time, |
| | | end_time, |
| | | type, |
| | | dept_id, |
| | | del_flag, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | remark |
| | | from electricity_type_setting_item |
| | | </sql> |
| | | |
| | | <select id="selectListByRuleId" |
| | | resultType="com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityTypeSettingItem"> |
| | | SELECT * |
| | | FROM electricity_type_setting_item |
| | | WHERE rule_id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertRuleDetails" parameterType="ElectricityTypeSettingItem"> |
| | | insert into electricity_type_setting_item |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">id,</if> |
| | | <if test="ruleId != null ">rule_id,</if> |
| | | <if test="type != null ">type,</if> |
| | | <if test="deptId != null ">dept_id,</if> |
| | | <if test="delFlag != null ">del_flag,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="createTime != null ">create_time,</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by,</if> |
| | | <if test="updateTime != null ">update_time,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | <if test="timePeriod != null ">time_period,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">#{id},</if> |
| | | <if test="ruleId != null ">#{ruleId},</if> |
| | | <if test="type != null ">#{type},</if> |
| | | <if test="deptId != null ">#{deptId},</if> |
| | | <if test="delFlag != null ">#{delFlag},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="createTime != null ">#{createTime},</if> |
| | | <if test="updateBy != null and updateBy != ''">#{updateBy},</if> |
| | | <if test="updateTime != null ">#{updateTime},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | <if test="timePeriod != null ">#{timePeriod},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateRuleDetails" parameterType="ElectricityTypeSettingItem"> |
| | | update electricity_type_setting_item |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="ruleId != null ">rule_id = #{ruleId},</if> |
| | | <if test="type != null ">type = #{type},</if> |
| | | <if test="deptId != null ">dept_id = #{deptId},</if> |
| | | <if test="delFlag != null ">del_flag = #{delFlag},</if> |
| | | <if test="createBy != null and createBy != ''">create_by = #{createBy},</if> |
| | | <if test="createTime != null ">create_time = #{createTime},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null ">update_time = #{updateTime},</if> |
| | | <if test="remark != null and remark != ''">remark = #{remark},</if> |
| | | <if test="timePeriod != null ">time_period = #{timePeriod},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteRuleDetailsById"> |
| | | delete |
| | | from electricity_type_setting_item |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | <delete id="deleteRulesByRuleId"> |
| | | delete |
| | | from electricity_type_setting_item |
| | | where rule_id = #{ruleId} |
| | | </delete> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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.dingzhuo.energy.project.electricityTypeSetting.mapper.ElectricityTypeSettingMapper"> |
| | | |
| | | <select id="selectList" |
| | | resultType="com.dingzhuo.energy.project.electricityTypeSetting.domain.vo.ElectricityTypeSettingPageListVO"> |
| | | select |
| | | id, |
| | | name, |
| | | sharp_fee AS sharpFee, |
| | | peak_fee AS peakFee, |
| | | flat_fee AS flatFee, |
| | | valley_fee AS valleyFee, |
| | | create_by AS createBy, |
| | | create_time AS createTime, |
| | | effective_date AS effectiveDate, |
| | | remark |
| | | from electricity_type_setting |
| | | <where> |
| | | <if test="name != null and name != ''"> |
| | | and name like concat('%', #{name}, '%') |
| | | </if> |
| | | and del_flag = '0' |
| | | </where> |
| | | order by create_time desc |
| | | </select> |
| | | <select id="selectById" |
| | | resultType="com.dingzhuo.energy.project.electricityTypeSetting.domain.entity.ElectricityTypeSetting"> |
| | | select id, |
| | | name, |
| | | effective_date, |
| | | sharp_fee, |
| | | peak_fee, |
| | | flat_fee, |
| | | valley_fee, |
| | | effective_date, |
| | | create_by, |
| | | create_time, |
| | | update_by, |
| | | update_time, |
| | | remark |
| | | from electricity_type_setting |
| | | where id = #{id} |
| | | </select> |
| | | |
| | | <insert id="insertRules" parameterType="ElectricityTypeSetting"> |
| | | insert into electricity_type_setting |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">id,</if> |
| | | <if test="name != null and name != ''">name,</if> |
| | | <if test="sharpFee != null ">sharp_fee,</if> |
| | | <if test="peakFee != null ">peak_fee,</if> |
| | | <if test="flatFee != null ">flat_fee,</if> |
| | | <if test="valleyFee != null ">valley_fee,</if> |
| | | <if test="effectiveDate != null ">effective_date,</if> |
| | | <if test="deptId != null ">dept_id,</if> |
| | | <if test="delFlag != null ">del_flag,</if> |
| | | <if test="createBy != null and createBy != ''">create_by,</if> |
| | | <if test="createTime != null ">create_time,</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by,</if> |
| | | <if test="updateTime != null ">update_time,</if> |
| | | <if test="remark != null and remark != ''">remark,</if> |
| | | </trim> |
| | | <trim prefix="values (" suffix=")" suffixOverrides=","> |
| | | <if test="id != null ">#{id},</if> |
| | | <if test="name != null and name != ''">#{name},</if> |
| | | <if test="sharpFee != null ">#{sharpFee},</if> |
| | | <if test="peakFee != null ">#{peakFee},</if> |
| | | <if test="flatFee != null ">#{flatFee},</if> |
| | | <if test="valleyFee != null ">#{valleyFee},</if> |
| | | <if test="effectiveDate != null ">#{effectiveDate},</if> |
| | | <if test="deptId != null ">#{deptId},</if> |
| | | <if test="delFlag != null ">#{delFlag},</if> |
| | | <if test="createBy != null and createBy != ''">#{createBy},</if> |
| | | <if test="createTime != null ">#{createTime},</if> |
| | | <if test="updateBy != null and updateBy != ''">#{updateBy},</if> |
| | | <if test="updateTime != null ">#{updateTime},</if> |
| | | <if test="remark != null and remark != ''">#{remark},</if> |
| | | </trim> |
| | | </insert> |
| | | |
| | | <update id="updateRules" parameterType="ElectricityTypeSetting"> |
| | | update electricity_type_setting |
| | | <trim prefix="SET" suffixOverrides=","> |
| | | <if test="name != null and name != ''">name = #{name},</if> |
| | | <if test="sharpFee != null ">sharp_fee = #{sharpFee},</if> |
| | | <if test="peakFee != null ">peak_fee = #{peakFee},</if> |
| | | <if test="flatFee != null ">flat_fee = #{flatFee},</if> |
| | | <if test="valleyFee != null ">valley_fee = #{valleyFee},</if> |
| | | <if test="effectiveDate != null ">valley_fee = #{effectiveDate},</if> |
| | | <if test="createBy != null and createBy != ''">create_by = #{createBy},</if> |
| | | <if test="createTime != null ">create_time = #{createTime},</if> |
| | | <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> |
| | | <if test="updateTime != null ">update_time = #{updateTime},</if> |
| | | <if test="remark != null and remark != ''">remark = #{remark},</if> |
| | | </trim> |
| | | where id = #{id} |
| | | </update> |
| | | |
| | | <delete id="deleteRulesById"> |
| | | delete |
| | | from electricity_type_setting |
| | | where id = #{id} |
| | | </delete> |
| | | |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import request from "@/utils/request"; |
| | | |
| | | export default { |
| | | // æ¥è¯¢åæ°å表 |
| | | pageRule(query) { |
| | | return request({ |
| | | url: "/rule/list", |
| | | method: "get", |
| | | params: query |
| | | }); |
| | | }, |
| | | addRule(query) { |
| | | return request({ |
| | | url: "/rule/addRule", |
| | | method: "post", |
| | | data: query |
| | | }); |
| | | }, |
| | | editRule(query) { |
| | | return request({ |
| | | url: "/rule/updateRule", |
| | | method: "post", |
| | | data: query |
| | | }); |
| | | }, |
| | | delRule(query) { |
| | | return request({ |
| | | url: "/rule/delRule/" + query.id, |
| | | method: "delete", |
| | | params: query |
| | | }); |
| | | }, |
| | | getRuleDetail(query) { |
| | | return request({ |
| | | url: "/rule/getRuleDetail", |
| | | method: "get", |
| | | params: query |
| | | }); |
| | | } |
| | | }; |
| | |
| | | <div :class="{ hasTagsView: needTagsView }" class="main-container"> |
| | | <div :class="{ 'fixed-header': fixedHeader }"> |
| | | <navbar /> |
| | | <!-- <div style="height: 70px;background: #fff;"> |
| | | caidan-èå |
| | | </div> --> |
| | | <div class="tabs-container"> |
| | | <el-tabs |
| | | v-model="activePage" |
| | | type="card" |
| | | closable |
| | | @edit="handleTabsEdit" |
| | | > |
| | | <el-tab-pane |
| | | :id="page.fullPath" |
| | | :key="page.fullPath" |
| | | v-for="(page, index) in pageList" |
| | | :label="page.meta.title" |
| | | :name="page.fullPath" |
| | | :closable="!(page.meta.title == 'é¦é¡µ')" |
| | | > |
| | | <!-- {{ page.content }} --> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | </div> |
| | | </div> |
| | | <app-main /> |
| | | </div> |
| | |
| | | import ResizeMixin from "./mixin/ResizeHandler"; |
| | | import { mapState } from "vuex"; |
| | | |
| | | const indexKey = "/index"; |
| | | export default { |
| | | name: "Layout", |
| | | components: { |
| | |
| | | RightPanel, |
| | | Sidebar |
| | | }, |
| | | data() { |
| | | return { |
| | | pageList: [], |
| | | linkList: [], |
| | | activePage: "", |
| | | multipage: true |
| | | }; |
| | | }, |
| | | mixins: [ResizeMixin], |
| | | computed: { |
| | | ...mapState({ |
| | |
| | | device: state => state.app.device, |
| | | showSettings: state => state.settings.showSettings, |
| | | needTagsView: state => state.settings.tagsView, |
| | | fixedHeader: state => state.settings.fixedHeader |
| | | fixedHeader: state => state.settings.fixedHeader, |
| | | tagsView: state => state.tagsView |
| | | }), |
| | | classObj() { |
| | | return { |
| | |
| | | }; |
| | | } |
| | | }, |
| | | created() { |
| | | if (this.$route.path !== indexKey) { |
| | | this.addIndexToFirst(); |
| | | } |
| | | // å¤å¶ä¸ä¸ªrouteå¯¹è±¡åºæ¥ï¼ä¸è½å½±ååroute |
| | | let currentRoute = Object.assign({}, this.$route); |
| | | currentRoute.meta = Object.assign({}, currentRoute.meta); |
| | | this.pageList.push(currentRoute); |
| | | this.linkList.push(currentRoute.fullPath); |
| | | this.activePage = currentRoute.fullPath; |
| | | console.log("pageList", this.pageList); |
| | | }, |
| | | watch: { |
| | | $route: function(newRoute) { |
| | | this.activePage = newRoute.fullPath; |
| | | if (!this.multipage) { |
| | | this.linkList = [newRoute.fullPath]; |
| | | this.pageList = [Object.assign({}, newRoute)]; |
| | | // update-begin-author:taoyan date:20200211 for: TASK #3368 ãè·¯ç±ç¼åãé¦é¡µçç¼å设置æé®é¢ï¼éè¦æ ¹æ®åå°çè·¯ç±é
ç½®æ¥å®ç°æ¯å¦ç¼å |
| | | } else if (indexKey == newRoute.fullPath) { |
| | | //é¦é¡µæ¶ 夿æ¯å¦ç¼å 没æç¼å å·æ°ä¹ |
| | | if (newRoute.meta.keepAlive === false) { |
| | | this.routeReload(); |
| | | } |
| | | // update-end-author:taoyan date:20200211 for: TASK #3368 ãè·¯ç±ç¼åãé¦é¡µçç¼å设置æé®é¢ï¼éè¦æ ¹æ®åå°çè·¯ç±é
ç½®æ¥å®ç°æ¯å¦ç¼å |
| | | } else if (this.linkList.indexOf(newRoute.fullPath) < 0) { |
| | | this.linkList.push(newRoute.fullPath); |
| | | this.pageList.push(Object.assign({}, newRoute)); |
| | | //// update-begin-author:sunjianlei date:20200103 for: 妿æ°å¢ç页é¢é
ç½®äºç¼åè·¯ç±ï¼é£ä¹å°±å¼ºå¶å·æ°ä¸é #842 |
| | | // if (newRoute.meta.keepAlive) { |
| | | // this.routeReload() |
| | | // } |
| | | //// update-end-author:sunjianlei date:20200103 for: 妿æ°å¢ç页é¢é
ç½®äºç¼åè·¯ç±ï¼é£ä¹å°±å¼ºå¶å·æ°ä¸é #842 |
| | | } else if (this.linkList.indexOf(newRoute.fullPath) >= 0) { |
| | | let oldIndex = this.linkList.indexOf(newRoute.fullPath); |
| | | let oldPositionRoute = this.pageList[oldIndex]; |
| | | this.pageList.splice( |
| | | oldIndex, |
| | | 1, |
| | | Object.assign({}, newRoute, { meta: oldPositionRoute.meta }) |
| | | ); |
| | | } |
| | | }, |
| | | activePage: function(key) { |
| | | let index = this.linkList.lastIndexOf(key); |
| | | let waitRouter = this.pageList[index]; |
| | | // ãTESTA-523ãä¿®å¤ï¼ä¸å
许éå¤è·³è½¬è·¯ç±å¼å¸¸ |
| | | if (waitRouter.fullPath !== this.$route.fullPath) { |
| | | this.$router.push(Object.assign({}, waitRouter)); |
| | | } |
| | | // this.changeTitle(waitRouter.meta.title); |
| | | } |
| | | }, |
| | | methods: { |
| | | addIndexToFirst() { |
| | | this.pageList.splice(0, 0, { |
| | | name: "home", |
| | | path: indexKey, |
| | | fullPath: indexKey, |
| | | meta: { |
| | | icon: "dashboard", |
| | | title: "é¦é¡µ" |
| | | } |
| | | }); |
| | | this.linkList.splice(0, 0, indexKey); |
| | | }, |
| | | changePage(key) { |
| | | this.activePage = key; |
| | | }, |
| | | handleTabsEdit(key, action) { |
| | | console.log("handleTabsEdit", key, action); |
| | | this[action](key); |
| | | }, |
| | | remove(key) { |
| | | if (key == indexKey) { |
| | | this.$message({ |
| | | message: "é¦é¡µä¸è½å
³é!", |
| | | type: "warning" |
| | | }); |
| | | return; |
| | | } |
| | | if (this.pageList.length === 1) { |
| | | this.$message({ |
| | | message: "è¿æ¯æåä¸é¡µï¼ä¸è½åå
³éäºå¦", |
| | | type: "warning" |
| | | }); |
| | | return; |
| | | } |
| | | let removeRoute = this.pageList.filter(item => item.fullPath == key); |
| | | this.pageList = this.pageList.filter(item => item.fullPath !== key); |
| | | let index = this.linkList.indexOf(key); |
| | | this.linkList = this.linkList.filter(item => item !== key); |
| | | index = index >= this.linkList.length ? this.linkList.length - 1 : index; |
| | | this.activePage = this.linkList[index]; |
| | | |
| | | //update-begin--Author:scott Date:20201015 forï¼è·¯ç±ç¼åé®é¢ï¼å
³éäºtab页æ¶åæå¼å°±ä¸å·æ° #842 |
| | | //å
³é页é¢åä»ç¼åcache_included_routesä¸å é¤è·¯ç±ï¼ä¸æ¬¡ç¹å»èåä¼éæ°å è½½é¡µé¢ |
| | | // let cacheRouterArray = Vue.ls.get(CACHE_INCLUDED_ROUTES) || []; |
| | | // if (removeRoute && removeRoute[0]) { |
| | | // let componentName = removeRoute[0].meta.componentName; |
| | | // if (cacheRouterArray.includes(componentName)) { |
| | | // cacheRouterArray.splice( |
| | | // cacheRouterArray.findIndex(item => item === componentName), |
| | | // 1 |
| | | // ); |
| | | // Vue.ls.set(CACHE_INCLUDED_ROUTES, cacheRouterArray); |
| | | // } |
| | | // this.emitPageClosed(removeRoute[0]); |
| | | // } |
| | | //update-end--Author:scott Date:20201015 forï¼è·¯ç±ç¼åé®é¢ï¼å
³éäºtab页æ¶åæå¼å°±ä¸å·æ° #842 |
| | | }, |
| | | handleClickOutside() { |
| | | this.$store.dispatch("app/closeSideBar", { withoutAnimation: false }); |
| | | } |
| | |
| | | position: relative; |
| | | height: 100%; |
| | | width: 100%; |
| | | background: #001233; |
| | | |
| | | &.mobile.openSidebar { |
| | | position: fixed; |
| | |
| | | } |
| | | } |
| | | |
| | | .tabs-container { |
| | | // background: #fff; |
| | | background: #001233; |
| | | height: #{$tabBarHeight}; |
| | | ::v-deep { |
| | | .el-tabs__item { |
| | | height: #{$tabBarHeight}; |
| | | line-height: #{$tabBarHeight}; |
| | | background: url("../assets/image/breadcrumbBg.png") no-repeat; |
| | | background-size: 100% 100%; |
| | | border: none; |
| | | margin-right: 10px; |
| | | color: #95c1fd; |
| | | } |
| | | .is-active { |
| | | color: #fff; |
| | | background: url("../assets/image/isbreadcrumbBg.png") no-repeat; |
| | | background-size: 100% 100%; |
| | | } |
| | | .el-tabs__nav { |
| | | border: none !important; |
| | | } |
| | | .el-tabs__header { |
| | | margin: 0 !important; |
| | | } |
| | | .el-tabs--card > .el-tabs__header { |
| | | border-bottom: none; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .drawer-bg { |
| | | background: #000; |
| | | opacity: 0.3; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | :inline="true" |
| | | label-width="68px" |
| | | > |
| | | <el-form-item label="ç»è®¡æ¶é´"> |
| | | <el-date-picker |
| | | clearable |
| | | size="small" |
| | | style="width: 100%" |
| | | v-model="queryParams.queryTime" |
| | | type="month" |
| | | :clearable="false" |
| | | value-format="yyyy-MM" |
| | | placeholder="éæ©æä»½" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| | | >éç½®</el-button |
| | | > |
| | | <!--<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport">导åº</el-button>--> |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-row :gutter="32"> |
| | | <el-col :xs="24" :sm="24" :lg="24"> |
| | | <el-table border style="width: 100%" :data="tabledata"> |
| | | <el-table-column |
| | | prop="time" |
| | | label="æ¥æ" |
| | | width="150" |
| | | ></el-table-column> |
| | | <el-table-column label="å°æ¶æ®µ"> |
| | | <el-table-column label="çµé" prop="sharpPower" /> |
| | | <el-table-column label="è´¹ç¨" prop="sharpFee" /> |
| | | </el-table-column> |
| | | <el-table-column label="å³°æ¶æ®µ"> |
| | | <el-table-column label="çµé" prop="peakPower" /> |
| | | <el-table-column label="è´¹ç¨" prop="peakFee" /> |
| | | </el-table-column> |
| | | <el-table-column label="å¹³æ¶æ®µ"> |
| | | <el-table-column label="çµé" prop="flatPower" /> |
| | | <el-table-column label="è´¹ç¨" prop="flatFee" /> |
| | | </el-table-column> |
| | | <el-table-column label="è°·æ¶æ®µ"> |
| | | <el-table-column label="çµé" prop="valleyPower" /> |
| | | <el-table-column label="è´¹ç¨" prop="valleyFee" /> |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- <el-row :gutter="32"> |
| | | <el-col :xs="24" :sm="24" :lg="24" > |
| | | <div class="chart-wrapper" style="margin-top: 20px;"> |
| | | <pie-chart ref="pieChart" :chart-data="pieChartData"/> |
| | | </div> |
| | | </el-col> |
| | | </el-row> --> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { getElectricityDataItemStatistics } from "@/api/electricityPrice/statistics"; |
| | | import pieChart from "./pieChart"; |
| | | export default { |
| | | components: { pieChart }, |
| | | data() { |
| | | return { |
| | | tablehead: [], |
| | | tabledata: [], |
| | | dateTypeOptions: [], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | timeType: "MONTH", |
| | | queryTime: "", |
| | | nodeId: undefined, |
| | | modelCode: undefined |
| | | }, |
| | | pieChartData: {}, |
| | | resultList: [], |
| | | skinName: "" |
| | | }; |
| | | }, |
| | | created() { |
| | | this.queryParams.queryTime = this.formatDate(new Date()); |
| | | }, |
| | | methods: { |
| | | modelNodeChange(node) { |
| | | this.queryParams.nodeId = node.id; |
| | | this.queryParams.nodeName = node.label; |
| | | this.getList(); |
| | | }, |
| | | getList() { |
| | | let params = { |
| | | ...this.queryParams, |
| | | timeType: "MONTH", |
| | | // modelCode: this.$route.query.modelCode |
| | | modelCode: "PEAK_VALLEY" |
| | | }; |
| | | getElectricityDataItemStatistics(params).then(response => { |
| | | this.tabledata = response.data; |
| | | }); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | numFilter(value) { |
| | | // æªåå½åæ°æ®å°å°æ°ç¹åçå ä½ |
| | | let realVal = ""; |
| | | if (!isNaN(value) && value !== "") { |
| | | realVal = parseFloat(value).toFixed(this.skinName); |
| | | } else { |
| | | realVal = "0.00"; |
| | | } |
| | | return realVal; |
| | | }, |
| | | |
| | | getTime() { |
| | | var myDate = new Date(); |
| | | var monthFirst = new Date( |
| | | myDate.getFullYear(), |
| | | parseInt(myDate.getMonth()) |
| | | ); |
| | | this.queryParams.beginTime = this.formatDate(monthFirst); |
| | | //this.queryParams.endTime=this.formatDate(monthFirst); |
| | | this.queryParams.endTime = this.getCurrentMonthLast(monthFirst); |
| | | }, |
| | | //è·åæä»½æåä¸å¤© |
| | | getCurrentMonthLast(endTime) { |
| | | var date = new Date(endTime); |
| | | var year = date.getFullYear(); |
| | | var month = date.getMonth() + 1; |
| | | month = month < 10 ? "0" + month : month; |
| | | var day = new Date(year, month, 0); |
| | | let endTimes = ""; |
| | | endTimes = year + "-" + month + "-" + day.getDate(); |
| | | return endTimes; |
| | | }, |
| | | formatDate: function(value) { |
| | | let date = new Date(value); |
| | | let y = date.getFullYear(); |
| | | let MM = date.getMonth() + 1; |
| | | MM = MM < 10 ? "0" + MM : MM; |
| | | let d = date.getDate(); |
| | | d = d < 10 ? "0" + d : d; |
| | | let h = date.getHours(); |
| | | h = h < 10 ? "0" + h : h; |
| | | let m = date.getMinutes(); |
| | | m = m < 10 ? "0" + m : m; |
| | | let s = date.getSeconds(); |
| | | s = s < 10 ? "0" + s : s; |
| | | return y + "-" + MM; |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style lang="scss"> |
| | | .el-table td, |
| | | .el-table th { |
| | | text-align: center !important; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <basic-container> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | label-width="72px" |
| | | class="special-form" |
| | | > |
| | | <el-row :gutter="24"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="çç¥åç§°" prop="name"> |
| | | <el-input |
| | | v-model="queryParams.name" |
| | | placeholder="请è¾å
¥çç¥åç§°" |
| | | clearable |
| | | size="small" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="18"> |
| | | <el-form-item class="operation"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="mini" |
| | | @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
| | | >éç½®</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | </basic-container> |
| | | <basic-container style="margin-top: 16px" :bodyStyle="bodyStyle"> |
| | | <el-row :gutter="10" class="mb8" style="margin-bottom: 19px"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-plus" |
| | | size="mini" |
| | | @click="handleAdd" |
| | | >æ°å¢ |
| | | </el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="tableData" |
| | | :height="height" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="55" align="center" /> |
| | | <el-table-column |
| | | label="计费çç¥åç§°" |
| | | prop="name" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <!-- <el-table-column label="å°è´¹ç¨" prop="sharpFee" /> |
| | | <el-table-column label="å³°è´¹ç¨" prop="peakFee" /> |
| | | <el-table-column label="平费ç¨" prop="flatFee" /> |
| | | <el-table-column label="è°·è´¹ç¨" prop="valleyFee" /> --> |
| | | <el-table-column label="æ¯å¦çæ" prop="effective" align="center"> |
| | | <template slot-scope="scope"> |
| | | {{ scope.row.effective ? "æ¯" : "å¦" }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="çææ¶é´" prop="effectiveDate" align="center" /> |
| | | <el-table-column label="å建æ¶é´" align="center" prop="createTime"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | width="240" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | >ä¿®æ¹ |
| | | </el-button> |
| | | <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | >å é¤ |
| | | </el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </basic-container> |
| | | <!-- æ·»å æä¿®æ¹--> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="open" |
| | | width="1000px" |
| | | class="dialog-form-row" |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="150px"> |
| | | <el-form-item class="nav-form-item" label="计费çç¥åç§°" prop="name"> |
| | | <el-input |
| | | maxlength="20" |
| | | v-model="form.name" |
| | | style="width: 425px" |
| | | placeholder="请è¾å
¥è®¡è´¹çç¥åç§°" |
| | | clearable |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item |
| | | class="nav-form-item" |
| | | label="çææ¶é´" |
| | | prop="effectiveDate" |
| | | > |
| | | <el-date-picker |
| | | clearabl |
| | | style="width: 425px" |
| | | v-model="form.effectiveDate" |
| | | type="date" |
| | | value-format="yyyy-MM-dd" |
| | | placeholder="éæ©çææ¶é´" |
| | | > |
| | | </el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item class="nav-form-item" label="夿³¨ä¿¡æ¯" prop="remark"> |
| | | <el-input |
| | | type="textarea" |
| | | maxlength="200" |
| | | v-model="form.remark" |
| | | style="width: 425px" |
| | | placeholder="请è¾å
¥å¤æ³¨ä¿¡æ¯" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item class="nav-form-item" label="çµè´¹ï¼å
/度ï¼"> |
| | | <el-row |
| | | v-for="(item, index) in priceTypeList" |
| | | :key="index" |
| | | style="margin-bottom: 5px" |
| | | > |
| | | <el-tag |
| | | :style=" |
| | | 'margin-right: 20px;color: #fff;background-color: ' + |
| | | item.cor + |
| | | ';border-color:' + |
| | | item.cor |
| | | " |
| | | >{{ item.txt }}</el-tag |
| | | > |
| | | <el-input-number |
| | | v-model="item.price" |
| | | controls-position="right" |
| | | :min="0.0" |
| | | :max="10" |
| | | :step="0.1" |
| | | style="width: 200px; margin-right: 10px" |
| | | ></el-input-number> |
| | | </el-row> |
| | | <div class="tipmincc" style="color: #fff;font-size: 13px;"> |
| | | ï¼å³°ãå¹³ãè°·æ¶æ®µä»·æ ¼å为å¿
填项ãå åå°çµä»·ä¸åï¼è¯·æ ¹æ®å½å°å®é
çµä»·å¡«åãï¼ |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item class="nav-form-item" label="æ¶æ®µè®¾ç½®"> |
| | | <el-row> |
| | | <el-button |
| | | v-for="(item, index) in priceTypeList" |
| | | :key="index" |
| | | :style=" |
| | | 'margin-right: 20px;color: #fff;margin-top: 5px;margin-bottom: 20px;background-color: ' + |
| | | item.cor + |
| | | ';border-color:' + |
| | | item.cor |
| | | " |
| | | @click="setTimeType(item.priceType)" |
| | | > |
| | | 设置为{{ item.txt }} |
| | | </el-button> |
| | | </el-row> |
| | | <el-row> |
| | | <div style="display: flex; flex-wrap: wrap"> |
| | | <div |
| | | class="time-item" |
| | | v-for="time in timePeriodList" |
| | | :key="time.value" |
| | | @click="time.selected = !time.selected" |
| | | > |
| | | <img |
| | | class="sel-img" |
| | | v-if="time.selected" |
| | | src="@/assets/icons/checked.png" |
| | | alt="" |
| | | /> |
| | | <img |
| | | class="sel-img" |
| | | v-else |
| | | src="@/assets/icons/checkbox.png" |
| | | alt="" |
| | | /> |
| | | <div |
| | | :style=" |
| | | 'color:#fff;background-color: ' + |
| | | colorArray[time.priceType] + |
| | | ';border-color:' + |
| | | colorArray[time.priceType] |
| | | " |
| | | class="time-type-div" |
| | | > |
| | | {{ txtArray[time.priceType] }} |
| | | </div> |
| | | <div style="color: #b1a2a2;">{{ time.time }}</div> |
| | | </div> |
| | | </div> |
| | | </el-row> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | const txtArray = ["", "å°", "å³°", "å¹³", "è°·"]; |
| | | const colorArray = ["", "#f56c6c", "#e6a23c", "#67c23a", "#909399"]; |
| | | |
| | | import ruleApi from "@/api/energyPrice/price"; |
| | | import { getTimePeriod } from "@/utils/index"; |
| | | import mixins from "@/layout/mixin/getHeight"; |
| | | export default { |
| | | name: "energyPrice", |
| | | mixins: [mixins], |
| | | data() { |
| | | return { |
| | | txtArray, |
| | | colorArray, |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // é䏿°ç» |
| | | codes: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // 计éå¨å
·æ¡£æ¡ç»´æ¤è¡¨æ ¼æ°æ® |
| | | tableData: [], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | |
| | | priceTypeList: [ |
| | | { |
| | | id: "", |
| | | priceType: 1, |
| | | price: 1, |
| | | servicePrice: 0.8, |
| | | parkFee: 1, |
| | | occupancyFee: 1, |
| | | txt: "å°æ¶æ®µ", |
| | | cor: "#f56c6c" |
| | | }, |
| | | { |
| | | id: "", |
| | | priceType: 2, |
| | | price: 1, |
| | | servicePrice: 0.8, |
| | | parkFee: 1, |
| | | occupancyFee: 1, |
| | | txt: "å³°æ¶æ®µ", |
| | | cor: "#e6a23c" |
| | | }, |
| | | { |
| | | id: "", |
| | | priceType: 3, |
| | | price: 1, |
| | | servicePrice: 0.8, |
| | | parkFee: 1, |
| | | occupancyFee: 1, |
| | | txt: "å¹³æ¶æ®µ", |
| | | cor: "#67c23a" |
| | | }, |
| | | { |
| | | id: "", |
| | | priceType: 4, |
| | | price: 1, |
| | | servicePrice: 0.8, |
| | | parkFee: 1, |
| | | occupancyFee: 1, |
| | | txt: "è°·æ¶æ®µ", |
| | | cor: "#909399" |
| | | } |
| | | ], |
| | | // ç¨æ·å¯¼å
¥åæ° |
| | | height: null, |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | code: undefined, |
| | | meterName: undefined, |
| | | meterType: undefined, |
| | | measureRange: undefined, |
| | | manufacturer: undefined, |
| | | installactionLocation: undefined |
| | | }, |
| | | // 表ååæ° |
| | | timePeriodList: [], |
| | | form: { |
| | | sum: 0, |
| | | remark: "", |
| | | ruleType: "", |
| | | name: "", |
| | | effectiveDate: "", |
| | | priceList: [] |
| | | }, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | name: [ |
| | | { required: true, message: "计费çç¥åç§°ä¸è½ä¸ºç©º", trigger: "blur" } |
| | | ] |
| | | } |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | setCharts() { |
| | | this.bodyStyle = { |
| | | height: window.innerHeight - 220 + "px", |
| | | overflow: "hidden" |
| | | }; |
| | | this.height = window.innerHeight - 340; |
| | | }, |
| | | /** æ¥è¯¢è®¡éå¨å
·æ¡£æ¡ç»´æ¤å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | ruleApi.pageRule(this.queryParams).then(response => { |
| | | this.tableData = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.open = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | name: undefined |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.resetForm("queryForm"); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map(item => item.id); |
| | | this.codes = selection.map(item => item.code); |
| | | this.single = selection.length != 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.open = true; |
| | | this.title = "æ·»å 计费çç¥"; |
| | | this.form.name = ""; |
| | | this.timePeriodList = []; |
| | | for (let i = 1; i < 49; i++) { |
| | | this.timePeriodList.push({ |
| | | value: i, |
| | | time: getTimePeriod(i), |
| | | priceType: 1, |
| | | selected: false |
| | | }); |
| | | } |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | const id = row.id; |
| | | ruleApi.getRuleDetail({ id }).then(response => { |
| | | let typeNameArr = ["sharp", "peak", "flat", "valley"]; |
| | | let typeArr = ["SHARP", "PEAK", "FLAT", "VALLEY"]; |
| | | this.form = response.data; |
| | | this.open = true; |
| | | this.title = "ä¿®æ¹è®¡è´¹çç¥"; |
| | | let ruleDetailList = response.data.ruleDetailList; |
| | | this.timePeriodList = ruleDetailList.map(item => { |
| | | return { |
| | | ...item, |
| | | value: item.timePeriod, |
| | | time: getTimePeriod(item.timePeriod), |
| | | priceType: typeArr.indexOf(item.type) + 1, |
| | | selected: false, |
| | | id: item.id |
| | | }; |
| | | }); |
| | | this.priceTypeList.forEach((item, index) => { |
| | | item.price = response.data[typeNameArr[index] + "Fee"]; |
| | | item.occupancyFee = |
| | | response.data[typeNameArr[index] + "OccupancyFee"]; |
| | | item.parkFee = response.data[typeNameArr[index] + "ParkingFee"]; |
| | | item.servicePrice = response.data[typeNameArr[index] + "ServiceFee"]; |
| | | }); |
| | | }); |
| | | }, |
| | | setTimeType(type) { |
| | | let arr = this.timePeriodList.filter(f => { |
| | | return f.selected; |
| | | }); |
| | | if (arr.length === 0) { |
| | | this.msgWarning("请è³å°éæ©ä¸ä¸ªæ¶æ®µ"); |
| | | return; |
| | | } |
| | | arr.forEach(element => { |
| | | element.priceType = type; |
| | | element.selected = false; |
| | | }); |
| | | }, |
| | | /** æäº¤æé® */ |
| | | submitForm: function() { |
| | | let typeArr = ["SHARP", "PEAK", "FLAT", "VALLEY"]; |
| | | // SHARP( "å°"), |
| | | // PEAK("å³°"), |
| | | // FLAT("å¹³"), |
| | | // VALLEY( "è°·"); |
| | | this.$refs["form"].validate(valid => { |
| | | if (valid) { |
| | | let params = { |
| | | name: this.form.name, |
| | | id: this.form.id, |
| | | remark: this.form.remark, |
| | | effectiveDate: this.form.effectiveDate, |
| | | sharpFee: this.priceTypeList[0].price, //å°æ¶æ®µ |
| | | peakFee: this.priceTypeList[1].price, //å³°æ¶æ®µ |
| | | flatFee: this.priceTypeList[2].price, //å¹³æ¶æ®µ |
| | | valleyFee: this.priceTypeList[3].price, //è°·æ¶æ®µ |
| | | ruleDetailList: this.timePeriodList.map(item => { |
| | | return { |
| | | timePeriod: item.value, |
| | | type: typeArr[item.priceType - 1], |
| | | id: item.id || "" |
| | | }; |
| | | }) |
| | | }; |
| | | if (this.form.id != undefined) { |
| | | ruleApi.editRule(params).then(response => { |
| | | if (response.code === 200) { |
| | | this.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } else { |
| | | ruleApi.addRule(params).then(response => { |
| | | if (response.code === 200) { |
| | | this.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | } else { |
| | | this.msgError(response.msg); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const id = row.id; |
| | | const name = row.name; |
| | | this.$confirm('æ¯å¦ç¡®è®¤å é¤"' + name + '"çæ°æ®é¡¹?', "è¦å", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | type: "warning" |
| | | }) |
| | | .then(function() { |
| | | return ruleApi.delRule({ id }); |
| | | }) |
| | | .then(() => { |
| | | this.getList(); |
| | | this.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(function() {}); |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"> |
| | | .special-form { |
| | | @import "~@/assets/styles/common-table-form.scss"; |
| | | } |
| | | |
| | | .dialog-form-row { |
| | | .el-row { |
| | | margin-bottom: 0; |
| | | } |
| | | } |
| | | ::v-deep .el-dialog__body { |
| | | height: 75vh; |
| | | overflow: hidden; |
| | | overflow-y: auto; |
| | | } |
| | | .time-item { |
| | | margin-right: 12px; |
| | | border: 1px solid #eaeaea; |
| | | border-radius: 4px; |
| | | text-align: center; |
| | | margin-bottom: 12px; |
| | | width: 100px; |
| | | position: relative; |
| | | cursor: pointer; |
| | | .time-type-div { |
| | | border-radius: 4px 4px 0 0; |
| | | } |
| | | .sel-img { |
| | | position: absolute; |
| | | width: 15px; |
| | | height: 15px; |
| | | background: #fff; |
| | | border-radius: 2px; |
| | | left: 6px; |
| | | top: 6px; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | .home-show { |
| | | background: #f0f2f5; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | height: calc(100vh - 90px); |
| | |
| | | </div> |
| | | </div> |
| | | </el-card> --> |
| | | <el-card |
| | | class="body-left-title" |
| | | :bordered="false" |
| | | style="margin-bottom: 12px;" |
| | | > |
| | | <div slot="header" class="clearfix"> |
| | | <span>彿¥åæ§æ°æ®ææ æ»è§</span> |
| | | </div> |
| | | <el-row class="double-data-show-content"> |
| | | <el-col :span="5" class="total"> |
| | | <img alt="" src="~@/assets/home/zonghe.svg" /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div>å
¨å综åè½è</div> |
| | | <div class="unit">{{ summation }} tce</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col |
| | | :span="5" |
| | | class="co2" |
| | | v-for="(item, index) in energyStatistic" |
| | | :key="index" |
| | | style="border-left: 1px solid #999;" |
| | | > |
| | | <img |
| | | v-if="item.item.includes('çµ')" |
| | | src="~@/assets/home/haodian.svg" |
| | | alt="" |
| | | /> |
| | | <img |
| | | v-if="item.item.includes('æ°´')" |
| | | src="~@/assets/home/haoshui.svg" |
| | | alt="" |
| | | /> |
| | | <img |
| | | v-if="item.item.includes('æ°')" |
| | | src="~@/assets/home/haoqi.svg" |
| | | alt="" |
| | | /> |
| | | <img |
| | | v-if="item.item.includes('è¸æ±½')" |
| | | src="~@/assets/home/haozhengqi.svg" |
| | | alt="" |
| | | /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div> |
| | | è{{ |
| | | item.item.indexOf("天ç¶") !== -1 |
| | | ? item.item.replace("天ç¶", "") |
| | | : item.item |
| | | }}é |
| | | {{ item.unit ? `ï¼${item.unit}ï¼` : "" }} |
| | | </div> |
| | | <div class="unit"> |
| | | {{ item.count || 0 }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="5" class="total" style="border-left: 1px solid #999;"> |
| | | <img alt="" src="~@/assets/home/wen.png" /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div>室夿¸©åº¦</div> |
| | | <div class="unit">{{ temperature }}</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col :span="5" class="total" style="border-left: 1px solid #999;"> |
| | | <img alt="" src="~@/assets/home/shi.png" /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div>室夿¹¿åº¦</div> |
| | | <div class="unit">{{ humidity }}</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-row type="flex" class="data-indicator-overview"> |
| | | <el-col class="home-body-left"> |
| | | <el-card class="body-left-title" :bordered="false"> |
| | | <div slot="header" class="clearfix"> |
| | | <span>彿¥åæ§æ°æ®ææ æ»è§</span> |
| | | </div> |
| | | <el-row class="double-data-show-content"> |
| | | <el-col :span="4" class="total"> |
| | | <img alt="" src="~@/assets/home/zonghe.svg" /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div>å
¨å综åè½è</div> |
| | | <div class="unit">{{ summation }} tce</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col |
| | | :span="5" |
| | | class="co2" |
| | | v-for="(item, index) in energyStatistic" |
| | | :key="index" |
| | | style="border-left: 1px solid #e9e9e9;" |
| | | > |
| | | <img |
| | | v-if="item.item.includes('çµ')" |
| | | src="~@/assets/home/haodian.svg" |
| | | alt="" |
| | | /> |
| | | <img |
| | | v-if="item.item.includes('æ°´')" |
| | | src="~@/assets/home/haoshui.svg" |
| | | alt="" |
| | | /> |
| | | <img |
| | | v-if="item.item.includes('æ°')" |
| | | src="~@/assets/home/haoqi.svg" |
| | | alt="" |
| | | /> |
| | | <img |
| | | v-if="item.item.includes('è¸æ±½')" |
| | | src="~@/assets/home/haozhengqi.svg" |
| | | alt="" |
| | | /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div> |
| | | è{{ |
| | | item.item.indexOf("天ç¶") !== -1 |
| | | ? item.item.replace("天ç¶", "") |
| | | : item.item |
| | | }}é |
| | | {{ item.unit ? `ï¼${item.unit}ï¼` : "" }} |
| | | </div> |
| | | <div class="unit"> |
| | | {{ item.count || 0 }} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col |
| | | :span="5" |
| | | class="total" |
| | | style="border-left: 1px solid #e9e9e9;" |
| | | > |
| | | <img alt="" src="~@/assets/home/wen.png" /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div>室夿¸©åº¦</div> |
| | | <div class="unit">{{ temperature }}</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <el-col |
| | | :span="5" |
| | | class="total" |
| | | style="border-left: 1px solid #e9e9e9;" |
| | | > |
| | | <img alt="" src="~@/assets/home/shi.png" /> |
| | | <div class="left-title-style"> |
| | | <div> |
| | | <div>室夿¹¿åº¦</div> |
| | | <div class="unit">{{ humidity }}</div> |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | </el-row> |
| | | </el-card> |
| | | <el-card :bordered="false" class="body-left-title"> |
| | | <div slot="header" class="clearfix"> |
| | | <span>è½æºå®æ¶çæµ</span> |
| | |
| | | }}</span> |
| | | <BarChart class="line-content" :chartData="chartDataObj" /> |
| | | </div> |
| | | <div class="chart-wrapper" style="border-top: 1px solid #e9e9e9"> |
| | | <div class="chart-wrapper" style="border-top: 1px solid #999"> |
| | | <span class="chart-left-unit">{{ |
| | | `æ°´/åä½${monitoringWaterUnit}` |
| | | }}</span> |
| | |
| | | class="second-chat" |
| | | :chartData="secondPieData" |
| | | pieTitle="è½è设å¤å æ¯" |
| | | height="280px" |
| | | /> |
| | | </el-card> |
| | | </el-col> |
| | |
| | | getHomeOutdoorTemperature |
| | | } from "@/api/home/home"; |
| | | import mixins from "@/layout/mixin/getHeight"; |
| | | import moment from "moment"; |
| | | import PieChart from "./dashboard/PieChart"; |
| | | import LineChart from "./dashboard/LineChart"; |
| | | import BarChart from "./dashboard/BarChart"; |
| | |
| | | clearInterval(this.timer); |
| | | clearInterval(this.timer30); |
| | | this.getHomeOutdoorTemperatureData(); |
| | | this.timer = setInterval(() => { |
| | | this.getHomeOutdoorTemperatureData(); |
| | | }, 12000); |
| | | // this.timer = setInterval(() => { |
| | | // this.getHomeOutdoorTemperatureData(); |
| | | // }, 12000); |
| | | this.timer30 = setInterval(() => { |
| | | // this.getEnergyType(); |
| | | this.getSummationData(); |
| | |
| | | |
| | | <style lang="scss" scoped> |
| | | .home-show { |
| | | background: #f0f2f5; |
| | | overflow: hidden; |
| | | overflow-y: scroll; |
| | | height: calc(100vh - 90px); |
| | | // height: calc(100vh - 88px); |
| | | .home-head { |
| | | display: flex; |
| | | align-items: center; |
| | | |
| | | .home-select-label { |
| | | margin-right: 10px; |
| | | color: #000; |
| | | color: #fff; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .select-month { |
| | | margin: 0 8px; |
| | | } |
| | | } |
| | | .double-data-show-content { |
| | | display: flex; |
| | | align-items: center; |
| | | // border-bottom: 1px solid #e9e9e9; |
| | | // padding: 23px 0 24px 40px; |
| | | .el-col { |
| | | padding: 23px 0 24px 10px; |
| | | } |
| | | |
| | | & > div { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | img { |
| | | width: 20px; |
| | | height: 20px; |
| | | } |
| | | |
| | | .left-title-style { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 10px; |
| | | // border-right: 1px solid #e9e9e9; |
| | | |
| | | .unit { |
| | | font-size: 22px; |
| | | color: #fff; |
| | | margin-top: 4px; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | position: absolute; |
| | | top: 16px; |
| | | left: 24px; |
| | | color: #333; |
| | | color: #fff; |
| | | font-size: 18px; |
| | | } |
| | | |
| | |
| | | margin: 0 16px 0px 0; |
| | | } |
| | | |
| | | .double-data-show-content { |
| | | display: flex; |
| | | align-items: center; |
| | | // border-bottom: 1px solid #e9e9e9; |
| | | // padding: 23px 0 24px 40px; |
| | | .el-col { |
| | | padding: 23px 0 24px 10px; |
| | | } |
| | | |
| | | & > div { |
| | | display: flex; |
| | | align-items: center; |
| | | } |
| | | |
| | | img { |
| | | width: 20px; |
| | | height: 20px; |
| | | } |
| | | |
| | | .left-title-style { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 10px; |
| | | // border-right: 1px solid #e9e9e9; |
| | | |
| | | .unit { |
| | | font-size: 22px; |
| | | color: #000000; |
| | | margin-top: 4px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .left-line-style { |
| | | padding: 24px; |
| | | color: #000000; |
| | | color: #fff; |
| | | |
| | | .radio-list { |
| | | width: 122px; |
| | |
| | | position: absolute; |
| | | top: 16px; |
| | | left: 0; |
| | | color: #333; |
| | | color: #fff; |
| | | } |
| | | |
| | | .line-content { |
| | |
| | | |
| | | .number { |
| | | font-size: 24px; |
| | | color: #000000; |
| | | color: #fff; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | .first-chat { |
| | | margin: 10px 0 0 0; |
| | | height: 340px; |
| | | height: 300px; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | .second-chat { |
| | | margin: 10px 0 0 0; |
| | | height: 340px; |
| | | height: 290px; |
| | | } |
| | | |
| | | .bottom-description-list { |
| | |
| | | |
| | | .energy-cost-sum { |
| | | font-size: 24px; |
| | | color: #000000; |
| | | color: #fff; |
| | | } |
| | | } |
| | | |
| | |
| | | <template> |
| | | <div class="dashboard-editor-container"> |
| | | |
| | | <panel-group @handleSetLineChartData="handleSetLineChartData" /> |
| | | |
| | | <el-row style="background:#fff;padding:16px 16px 0;margin-bottom:32px;"> |
| | | <el-row style="padding:16px 16px 0;margin-bottom:32px;"> |
| | | <line-chart :chart-data="lineChartData" /> |
| | | </el-row> |
| | | |
| | |
| | | |
| | | <!--<!–宿¶–>--> |
| | | <!--<div class="live">--> |
| | | <!--<div class="live_content">宿¶æ¥è¦</div>--> |
| | | <!--<div class="live_number">35</div>--> |
| | | <!--<div class="live_content">宿¶æ¥è¦</div>--> |
| | | <!--<div class="live_number">35</div>--> |
| | | <!--</div>--> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import PanelGroup from './dashboard/PanelGroup' |
| | | import LineChart from './dashboard/LineChart' |
| | | import RaddarChart from './dashboard/RaddarChart' |
| | | import PieChart from './dashboard/PieChart' |
| | | import BarChart from './dashboard/BarChart' |
| | | import PanelGroup from "./dashboard/PanelGroup"; |
| | | import LineChart from "./dashboard/LineChart"; |
| | | import RaddarChart from "./dashboard/RaddarChart"; |
| | | import PieChart from "./dashboard/PieChart"; |
| | | import BarChart from "./dashboard/BarChart"; |
| | | |
| | | const lineChartData = { |
| | | newVisitis: { |
| | |
| | | expectedData: [130, 140, 141, 142, 145, 150, 160], |
| | | actualData: [120, 82, 91, 154, 162, 140, 130] |
| | | } |
| | | } |
| | | }; |
| | | |
| | | export default { |
| | | name: 'Index', |
| | | name: "Index", |
| | | components: { |
| | | PanelGroup, |
| | | LineChart, |
| | |
| | | data() { |
| | | return { |
| | | lineChartData: lineChartData.newVisitis |
| | | } |
| | | }; |
| | | }, |
| | | methods: { |
| | | handleSetLineChartData(type) { |
| | | this.lineChartData = lineChartData[type] |
| | | this.lineChartData = lineChartData[type]; |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .dashboard-editor-container { |
| | | padding: 32px; |
| | | background-color: rgb(240, 242, 245); |
| | | position: relative; |
| | | |
| | | .chart-wrapper { |
| | | background: #fff; |
| | | padding: 16px 16px 0; |
| | | margin-bottom: 32px; |
| | | } |
| | | } |
| | | |
| | | @media (max-width:1024px) { |
| | | @media (max-width: 1024px) { |
| | | .chart-wrapper { |
| | | padding: 8px; |
| | | } |
| | | } |
| | | .live{ |
| | | position: fixed; |
| | | right: 0px; |
| | | top:70px; |
| | | display: flex; |
| | | flex-direction:column; |
| | | justify-content:center; |
| | | align-items:center; |
| | | width: 100px; |
| | | height: 60px; |
| | | background-color: red; |
| | | animation: fade 600ms infinite; |
| | | -webkit-animation: fade 600ms infinite; |
| | | } |
| | | .live_content{ |
| | | font-size: 18px; |
| | | color: white; |
| | | font-weight: bold; |
| | | } |
| | | .live_number{ |
| | | font-size: 32px; |
| | | color: white; |
| | | font-weight: bolder; |
| | | } |
| | | .live { |
| | | position: fixed; |
| | | right: 0px; |
| | | top: 70px; |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | | align-items: center; |
| | | width: 100px; |
| | | height: 60px; |
| | | background-color: red; |
| | | animation: fade 600ms infinite; |
| | | -webkit-animation: fade 600ms infinite; |
| | | } |
| | | .live_content { |
| | | font-size: 18px; |
| | | color: white; |
| | | font-weight: bold; |
| | | } |
| | | .live_number { |
| | | font-size: 32px; |
| | | color: white; |
| | | font-weight: bolder; |
| | | } |
| | | @keyframes fade { |
| | | from { |
| | | opacity: 1.0; |
| | | opacity: 1; |
| | | } |
| | | 50% { |
| | | opacity: 0.4; |
| | | } |
| | | to { |
| | | opacity: 1.0; |
| | | opacity: 1; |
| | | } |
| | | } |
| | | |
| | | @-webkit-keyframes fade { |
| | | from { |
| | | opacity: 1.0; |
| | | opacity: 1; |
| | | } |
| | | 50% { |
| | | opacity: 0.4; |
| | | } |
| | | to { |
| | | opacity: 1.0; |
| | | opacity: 1; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | :src="'https://www.toray.cn/shared/images/toray_logo_ch.svg'" |
| | | alt="" |
| | | /> |
| | | <div>ä¸ä¸½å»çè½æºç®¡çå¹³å°</div> |
| | | <div>综åè½æºç®¡çç³»ç»</div> |
| | | </div> |
| | | <div class="login"> |
| | | <div class="demo-image"> |
| | | <!-- <div class="demo-image"> |
| | | <el-image style="width: 75%;" :src="logo"></el-image> |
| | | </div> |
| | | </div> --> |
| | | <div class="login-form"> |
| | | <el-form ref="loginForm" :model="loginForm" :rules="loginRules"> |
| | | <div class="title">ç¨æ·ç»å½</div> |
| | | <!-- <div class="title">ç¨æ·ç»å½</div> --> |
| | | <div class="logo-view title"> |
| | | <img |
| | | style="width: 100px;margin-right: 30px " |
| | | :src="'https://www.toray.cn/shared/images/toray_logo_ch.svg'" |
| | | alt="" |
| | | /> |
| | | <div>综åè½æºç®¡çç³»ç»</div> |
| | | </div> |
| | | <el-form-item prop="username" style="margin-bottom: 21px"> |
| | | <el-input |
| | | v-model="loginForm.username" |
| | |
| | | <style rel="stylesheet/scss" lang="scss" scoped> |
| | | .logo-page { |
| | | height: 100%; |
| | | background-image: url("../assets/image/login-background.png"); |
| | | background-image: url("../assets/image/bg.jpg"); |
| | | // background-image: url("../assets/image/login-background.png"); |
| | | background-size: cover; |
| | | overflow: hidden; |
| | | // background: ; |
| | | // background: linear-gradient(80deg, #073b70 0%, rgba(7, 59, 112, 0) 100%); |
| | | // background: linear-gradient(90deg, #101d32 0%, rgba(0, 0, 0, 0.5) 100%); |
| | | |
| | | .logo-png { |
| | | font-size: 24px; |
| | | display: flex; |
| | | align-items: center; |
| | | font-weight: bold; |
| | | color: #333; |
| | | color: #fff; |
| | | padding: 3.4% 0 0 74px; |
| | | position: absolute; |
| | | } |
| | | |
| | | .login { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | // justify-content: space-between; |
| | | justify-content: center; |
| | | padding: 0 17.24%; |
| | | height: calc(100% - 73px * 2); |
| | | align-items: center; |
| | |
| | | .title { |
| | | font-size: 22px; |
| | | color: #38bcbf; |
| | | margin-bottom: 22px; |
| | | margin-bottom: 32px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .login-form { |
| | | border-radius: 10px; |
| | | background: #ffffff; |
| | | width: 32%; |
| | | padding: 25px 25px 5px 25px; |
| | | // background: #ffffff; |
| | | width: 36%; |
| | | padding: 32px 64px; |
| | | // background: #061844; |
| | | border-radius: 4px; |
| | | // box-shadow: 0 7px 14px 6px #2f4b9a; |
| | | margin-top: 6px; |
| | | border: 1px solid #061844; |
| | | background: rgba($color: #ffffff, $alpha: 0.06); |
| | | |
| | | .logo-view { |
| | | display: flex; |
| | | align-items: center; |
| | | color: #fff; |
| | | font-size: 26px; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .el-input { |
| | | height: 38px; |
| | |
| | | return path.join(__dirname, dir); |
| | | } |
| | | |
| | | const name = defaultSettings.title || "åºå·´è¿ªè½æºç®¡çç³»ç»"; // æ é¢ |
| | | const name = defaultSettings.title || "æºç¢³æªæ¥è½æºç®¡çç³»ç»"; // æ é¢ |
| | | |
| | | const port = process.env.port || process.env.npm_config_port || 80; // ç«¯å£ |
| | | |
| | |
| | | proxy: { |
| | | // detail: https://cli.vuejs.org/config/#devserver-proxy |
| | | [process.env.VUE_APP_BASE_API]: { |
| | | // target: 'http://47.110.84.144:8097', |
| | | target: "http://192.168.0.6:8097", |
| | | // target: "http://q7unm6.natappfree.cc", |
| | | target: "http://localhost:8097", |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | ["^" + process.env.VUE_APP_BASE_API]: "" |