feat:保存已经设计的面板

This commit is contained in:
wangjiahao
2021-03-22 17:27:16 +08:00
parent 69ae877b0a
commit 8a6b75eb97
25 changed files with 404 additions and 758 deletions

View File

@@ -13,17 +13,15 @@ public class PanelDesign implements Serializable {
private String componentStyle;
private String componentPosition;
private String componentType;
private String componentDetails;
private Long createTime;
private Long updateTime;
private String createPersion;
private String updatePersion;
private String updatePerson;
private static final long serialVersionUID = 1L;
}

View File

@@ -384,6 +384,76 @@ public class PanelDesignExample {
return (Criteria) this;
}
public Criteria andComponentPositionIsNull() {
addCriterion("component_position is null");
return (Criteria) this;
}
public Criteria andComponentPositionIsNotNull() {
addCriterion("component_position is not null");
return (Criteria) this;
}
public Criteria andComponentPositionEqualTo(String value) {
addCriterion("component_position =", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionNotEqualTo(String value) {
addCriterion("component_position <>", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionGreaterThan(String value) {
addCriterion("component_position >", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionGreaterThanOrEqualTo(String value) {
addCriterion("component_position >=", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionLessThan(String value) {
addCriterion("component_position <", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionLessThanOrEqualTo(String value) {
addCriterion("component_position <=", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionLike(String value) {
addCriterion("component_position like", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionNotLike(String value) {
addCriterion("component_position not like", value, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionIn(List<String> values) {
addCriterion("component_position in", values, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionNotIn(List<String> values) {
addCriterion("component_position not in", values, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionBetween(String value1, String value2) {
addCriterion("component_position between", value1, value2, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentPositionNotBetween(String value1, String value2) {
addCriterion("component_position not between", value1, value2, "componentPosition");
return (Criteria) this;
}
public Criteria andComponentTypeIsNull() {
addCriterion("component_type is null");
return (Criteria) this;
@@ -524,66 +594,6 @@ public class PanelDesignExample {
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Long value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Long value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Long value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Long value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Long value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Long value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Long> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Long> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Long value1, Long value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Long value1, Long value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
@@ -644,143 +654,73 @@ public class PanelDesignExample {
return (Criteria) this;
}
public Criteria andCreatePersionIsNull() {
addCriterion("create_persion is null");
public Criteria andUpdatePersonIsNull() {
addCriterion("update_person is null");
return (Criteria) this;
}
public Criteria andCreatePersionIsNotNull() {
addCriterion("create_persion is not null");
public Criteria andUpdatePersonIsNotNull() {
addCriterion("update_person is not null");
return (Criteria) this;
}
public Criteria andCreatePersionEqualTo(String value) {
addCriterion("create_persion =", value, "createPersion");
public Criteria andUpdatePersonEqualTo(String value) {
addCriterion("update_person =", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionNotEqualTo(String value) {
addCriterion("create_persion <>", value, "createPersion");
public Criteria andUpdatePersonNotEqualTo(String value) {
addCriterion("update_person <>", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionGreaterThan(String value) {
addCriterion("create_persion >", value, "createPersion");
public Criteria andUpdatePersonGreaterThan(String value) {
addCriterion("update_person >", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionGreaterThanOrEqualTo(String value) {
addCriterion("create_persion >=", value, "createPersion");
public Criteria andUpdatePersonGreaterThanOrEqualTo(String value) {
addCriterion("update_person >=", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionLessThan(String value) {
addCriterion("create_persion <", value, "createPersion");
public Criteria andUpdatePersonLessThan(String value) {
addCriterion("update_person <", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionLessThanOrEqualTo(String value) {
addCriterion("create_persion <=", value, "createPersion");
public Criteria andUpdatePersonLessThanOrEqualTo(String value) {
addCriterion("update_person <=", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionLike(String value) {
addCriterion("create_persion like", value, "createPersion");
public Criteria andUpdatePersonLike(String value) {
addCriterion("update_person like", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionNotLike(String value) {
addCriterion("create_persion not like", value, "createPersion");
public Criteria andUpdatePersonNotLike(String value) {
addCriterion("update_person not like", value, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionIn(List<String> values) {
addCriterion("create_persion in", values, "createPersion");
public Criteria andUpdatePersonIn(List<String> values) {
addCriterion("update_person in", values, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionNotIn(List<String> values) {
addCriterion("create_persion not in", values, "createPersion");
public Criteria andUpdatePersonNotIn(List<String> values) {
addCriterion("update_person not in", values, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionBetween(String value1, String value2) {
addCriterion("create_persion between", value1, value2, "createPersion");
public Criteria andUpdatePersonBetween(String value1, String value2) {
addCriterion("update_person between", value1, value2, "updatePerson");
return (Criteria) this;
}
public Criteria andCreatePersionNotBetween(String value1, String value2) {
addCriterion("create_persion not between", value1, value2, "createPersion");
return (Criteria) this;
}
public Criteria andUpdatePersionIsNull() {
addCriterion("update_persion is null");
return (Criteria) this;
}
public Criteria andUpdatePersionIsNotNull() {
addCriterion("update_persion is not null");
return (Criteria) this;
}
public Criteria andUpdatePersionEqualTo(String value) {
addCriterion("update_persion =", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionNotEqualTo(String value) {
addCriterion("update_persion <>", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionGreaterThan(String value) {
addCriterion("update_persion >", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionGreaterThanOrEqualTo(String value) {
addCriterion("update_persion >=", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionLessThan(String value) {
addCriterion("update_persion <", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionLessThanOrEqualTo(String value) {
addCriterion("update_persion <=", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionLike(String value) {
addCriterion("update_persion like", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionNotLike(String value) {
addCriterion("update_persion not like", value, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionIn(List<String> values) {
addCriterion("update_persion in", values, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionNotIn(List<String> values) {
addCriterion("update_persion not in", values, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionBetween(String value1, String value2) {
addCriterion("update_persion between", value1, value2, "updatePersion");
return (Criteria) this;
}
public Criteria andUpdatePersionNotBetween(String value1, String value2) {
addCriterion("update_persion not between", value1, value2, "updatePersion");
public Criteria andUpdatePersonNotBetween(String value1, String value2) {
addCriterion("update_person not between", value1, value2, "updatePerson");
return (Criteria) this;
}
}

View File

@@ -21,5 +21,7 @@ public class PanelGroup implements Serializable {
private String panelType;
private String panelStyle;
private static final long serialVersionUID = 1L;
}

View File

@@ -643,6 +643,76 @@ public class PanelGroupExample {
addCriterion("panel_type not between", value1, value2, "panelType");
return (Criteria) this;
}
public Criteria andPanelStyleIsNull() {
addCriterion("panel_style is null");
return (Criteria) this;
}
public Criteria andPanelStyleIsNotNull() {
addCriterion("panel_style is not null");
return (Criteria) this;
}
public Criteria andPanelStyleEqualTo(String value) {
addCriterion("panel_style =", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleNotEqualTo(String value) {
addCriterion("panel_style <>", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleGreaterThan(String value) {
addCriterion("panel_style >", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleGreaterThanOrEqualTo(String value) {
addCriterion("panel_style >=", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleLessThan(String value) {
addCriterion("panel_style <", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleLessThanOrEqualTo(String value) {
addCriterion("panel_style <=", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleLike(String value) {
addCriterion("panel_style like", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleNotLike(String value) {
addCriterion("panel_style not like", value, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleIn(List<String> values) {
addCriterion("panel_style in", values, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleNotIn(List<String> values) {
addCriterion("panel_style not in", values, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleBetween(String value1, String value2) {
addCriterion("panel_style between", value1, value2, "panelStyle");
return (Criteria) this;
}
public Criteria andPanelStyleNotBetween(String value1, String value2) {
addCriterion("panel_style not between", value1, value2, "panelStyle");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

View File

@@ -6,12 +6,11 @@
<result column="panel_id" jdbcType="VARCHAR" property="panelId" />
<result column="component_id" jdbcType="VARCHAR" property="componentId" />
<result column="component_style" jdbcType="VARCHAR" property="componentStyle" />
<result column="component_position" jdbcType="VARCHAR" property="componentPosition" />
<result column="component_type" jdbcType="VARCHAR" property="componentType" />
<result column="component_details" jdbcType="VARCHAR" property="componentDetails" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="update_time" jdbcType="BIGINT" property="updateTime" />
<result column="create_persion" jdbcType="VARCHAR" property="createPersion" />
<result column="update_persion" jdbcType="VARCHAR" property="updatePersion" />
<result column="update_person" jdbcType="VARCHAR" property="updatePerson" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@@ -72,8 +71,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, panel_id, component_id, component_style, component_type, component_details, create_time,
update_time, create_persion, update_persion
id, panel_id, component_id, component_style, component_position, component_type,
component_details, update_time, update_person
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.PanelDesignExample" resultMap="BaseResultMap">
select
@@ -107,13 +106,13 @@
</delete>
<insert id="insert" parameterType="io.dataease.base.domain.PanelDesign">
insert into panel_design (id, panel_id, component_id,
component_style, component_type, component_details,
create_time, update_time, create_persion,
update_persion)
component_style, component_position, component_type,
component_details, update_time, update_person
)
values (#{id,jdbcType=VARCHAR}, #{panelId,jdbcType=VARCHAR}, #{componentId,jdbcType=VARCHAR},
#{componentStyle,jdbcType=VARCHAR}, #{componentType,jdbcType=VARCHAR}, #{componentDetails,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, #{createPersion,jdbcType=VARCHAR},
#{updatePersion,jdbcType=VARCHAR})
#{componentStyle,jdbcType=VARCHAR}, #{componentPosition,jdbcType=VARCHAR}, #{componentType,jdbcType=VARCHAR},
#{componentDetails,jdbcType=VARCHAR}, #{updateTime,jdbcType=BIGINT}, #{updatePerson,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelDesign">
insert into panel_design
@@ -130,23 +129,20 @@
<if test="componentStyle != null">
component_style,
</if>
<if test="componentPosition != null">
component_position,
</if>
<if test="componentType != null">
component_type,
</if>
<if test="componentDetails != null">
component_details,
</if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="createPersion != null">
create_persion,
</if>
<if test="updatePersion != null">
update_persion,
<if test="updatePerson != null">
update_person,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
@@ -162,23 +158,20 @@
<if test="componentStyle != null">
#{componentStyle,jdbcType=VARCHAR},
</if>
<if test="componentPosition != null">
#{componentPosition,jdbcType=VARCHAR},
</if>
<if test="componentType != null">
#{componentType,jdbcType=VARCHAR},
</if>
<if test="componentDetails != null">
#{componentDetails,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
#{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=BIGINT},
</if>
<if test="createPersion != null">
#{createPersion,jdbcType=VARCHAR},
</if>
<if test="updatePersion != null">
#{updatePersion,jdbcType=VARCHAR},
<if test="updatePerson != null">
#{updatePerson,jdbcType=VARCHAR},
</if>
</trim>
</insert>
@@ -203,23 +196,20 @@
<if test="record.componentStyle != null">
component_style = #{record.componentStyle,jdbcType=VARCHAR},
</if>
<if test="record.componentPosition != null">
component_position = #{record.componentPosition,jdbcType=VARCHAR},
</if>
<if test="record.componentType != null">
component_type = #{record.componentType,jdbcType=VARCHAR},
</if>
<if test="record.componentDetails != null">
component_details = #{record.componentDetails,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=BIGINT},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=BIGINT},
</if>
<if test="record.createPersion != null">
create_persion = #{record.createPersion,jdbcType=VARCHAR},
</if>
<if test="record.updatePersion != null">
update_persion = #{record.updatePersion,jdbcType=VARCHAR},
<if test="record.updatePerson != null">
update_person = #{record.updatePerson,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
@@ -232,12 +222,11 @@
panel_id = #{record.panelId,jdbcType=VARCHAR},
component_id = #{record.componentId,jdbcType=VARCHAR},
component_style = #{record.componentStyle,jdbcType=VARCHAR},
component_position = #{record.componentPosition,jdbcType=VARCHAR},
component_type = #{record.componentType,jdbcType=VARCHAR},
component_details = #{record.componentDetails,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
update_time = #{record.updateTime,jdbcType=BIGINT},
create_persion = #{record.createPersion,jdbcType=VARCHAR},
update_persion = #{record.updatePersion,jdbcType=VARCHAR}
update_person = #{record.updatePerson,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@@ -254,23 +243,20 @@
<if test="componentStyle != null">
component_style = #{componentStyle,jdbcType=VARCHAR},
</if>
<if test="componentPosition != null">
component_position = #{componentPosition,jdbcType=VARCHAR},
</if>
<if test="componentType != null">
component_type = #{componentType,jdbcType=VARCHAR},
</if>
<if test="componentDetails != null">
component_details = #{componentDetails,jdbcType=VARCHAR},
</if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=BIGINT},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=BIGINT},
</if>
<if test="createPersion != null">
create_persion = #{createPersion,jdbcType=VARCHAR},
</if>
<if test="updatePersion != null">
update_persion = #{updatePersion,jdbcType=VARCHAR},
<if test="updatePerson != null">
update_person = #{updatePerson,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
@@ -280,12 +266,11 @@
set panel_id = #{panelId,jdbcType=VARCHAR},
component_id = #{componentId,jdbcType=VARCHAR},
component_style = #{componentStyle,jdbcType=VARCHAR},
component_position = #{componentPosition,jdbcType=VARCHAR},
component_type = #{componentType,jdbcType=VARCHAR},
component_details = #{componentDetails,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
update_time = #{updateTime,jdbcType=BIGINT},
create_persion = #{createPersion,jdbcType=VARCHAR},
update_persion = #{updatePersion,jdbcType=VARCHAR}
update_person = #{updatePerson,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -10,6 +10,7 @@
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
<result column="create_time" jdbcType="BIGINT" property="createTime" />
<result column="panel_type" jdbcType="VARCHAR" property="panelType" />
<result column="panel_style" jdbcType="VARCHAR" property="panelStyle" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@@ -70,7 +71,7 @@
</where>
</sql>
<sql id="Base_Column_List">
id, `name`, pid, `level`, node_type, create_by, create_time, panel_type
id, `name`, pid, `level`, node_type, create_by, create_time, panel_type, panel_style
</sql>
<select id="selectByExample" parameterType="io.dataease.base.domain.PanelGroupExample" resultMap="BaseResultMap">
select
@@ -105,10 +106,12 @@
<insert id="insert" parameterType="io.dataease.base.domain.PanelGroup">
insert into panel_group (id, `name`, pid,
`level`, node_type, create_by,
create_time, panel_type)
create_time, panel_type, panel_style
)
values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{pid,jdbcType=VARCHAR},
#{level,jdbcType=INTEGER}, #{nodeType,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=BIGINT}, #{panelType,jdbcType=VARCHAR})
#{createTime,jdbcType=BIGINT}, #{panelType,jdbcType=VARCHAR}, #{panelStyle,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="io.dataease.base.domain.PanelGroup">
insert into panel_group
@@ -137,6 +140,9 @@
<if test="panelType != null">
panel_type,
</if>
<if test="panelStyle != null">
panel_style,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -163,6 +169,9 @@
<if test="panelType != null">
#{panelType,jdbcType=VARCHAR},
</if>
<if test="panelStyle != null">
#{panelStyle,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="io.dataease.base.domain.PanelGroupExample" resultType="java.lang.Long">
@@ -198,6 +207,9 @@
<if test="record.panelType != null">
panel_type = #{record.panelType,jdbcType=VARCHAR},
</if>
<if test="record.panelStyle != null">
panel_style = #{record.panelStyle,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@@ -212,7 +224,8 @@
node_type = #{record.nodeType,jdbcType=VARCHAR},
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=BIGINT},
panel_type = #{record.panelType,jdbcType=VARCHAR}
panel_type = #{record.panelType,jdbcType=VARCHAR},
panel_style = #{record.panelStyle,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@@ -241,6 +254,9 @@
<if test="panelType != null">
panel_type = #{panelType,jdbcType=VARCHAR},
</if>
<if test="panelStyle != null">
panel_style = #{panelStyle,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
@@ -252,7 +268,8 @@
node_type = #{nodeType,jdbcType=VARCHAR},
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=BIGINT},
panel_type = #{panelType,jdbcType=VARCHAR}
panel_type = #{panelType,jdbcType=VARCHAR},
panel_style = #{panelStyle,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -1,6 +1,10 @@
package io.dataease.base.mapper.ext;
import org.apache.ibatis.annotations.Param;
public interface ExtPanelDesignMapper {
void deleteByPanelId(@Param("panelId") String panelId);
}

View File

@@ -6,4 +6,8 @@
</resultMap>
<delete id="deleteByPanelId">
delete from panel_design where panel_id =#{panelId}
</delete>
</mapper>

View File

@@ -0,0 +1,15 @@
package io.dataease.commons.constants;
/**
* Author: wangjiahao
* Date: 2021-03-22
* Description:
*/
public class PanelConstants {
public final static String COMPONENT_TYPE_VIEW = "view";
public final static String COMPONENT_TYPE_PUBLIC = "public";
}

View File

@@ -25,4 +25,10 @@ public class PanelDesignController {
// panelGroupService.deleteCircle(id);
// }
@PostMapping("/saveDesign/{id}")
public void deleteCircle(@PathVariable String id) {
panelGroupService.deleteCircle(id);
}
}

View File

@@ -51,4 +51,9 @@ public class PanelGroupController {
return panelGroupService.findOne(id);
}
@PostMapping("/saveGroupWithDesign")
public void saveGroupWithDesign(@RequestBody PanelGroupRequest request) {
panelGroupService.saveGroupWithDesign(request);
}
}

View File

@@ -1,6 +1,7 @@
package io.dataease.controller.request.panel;
import io.dataease.base.domain.PanelGroup;
import io.dataease.dto.panel.PanelGroupDTO;
import lombok.Data;
/**
@@ -9,7 +10,7 @@ import lombok.Data;
* Description:
*/
@Data
public class PanelGroupRequest extends PanelGroup {
public class PanelGroupRequest extends PanelGroupDTO {
private String sort;
public PanelGroupRequest() {

View File

@@ -15,6 +15,9 @@ public class PanelDesignDTO extends PanelDesign {
//当前视图是否在仪表盘中显示
private boolean keepFlag = false;
//当前视图是否已经进行样式初始化
private boolean styleInit = false;
private ChartViewDTO chartView;
private Object systemComponent;

View File

@@ -4,7 +4,9 @@ import io.dataease.base.domain.*;
import io.dataease.base.mapper.ChartViewMapper;
import io.dataease.base.mapper.PanelDesignMapper;
import io.dataease.base.mapper.PanelGroupMapper;
import io.dataease.base.mapper.ext.ExtPanelDesignMapper;
import io.dataease.base.mapper.ext.ExtPanelGroupMapper;
import io.dataease.commons.constants.PanelConstants;
import io.dataease.commons.utils.BeanUtils;
import io.dataease.controller.request.panel.PanelGroupRequest;
import io.dataease.dto.chart.ChartViewDTO;
@@ -17,6 +19,7 @@ import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.annotation.Resource;
@@ -24,6 +27,7 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* Author: wangjiahao
@@ -45,6 +49,8 @@ public class PanelGroupService {
private ChartViewService chartViewService;
@Resource
private ChartViewMapper chartViewMapper;
@Resource
private ExtPanelDesignMapper extPanelDesignMapper;
public List<PanelGroupDTO> tree(PanelGroupRequest panelGroupRequest) {
List<PanelGroupDTO> panelGroupDTOList = extPanelGroupMapper.panelGroupList(panelGroupRequest);
@@ -126,4 +132,38 @@ public class PanelGroupService {
return chartViewDTOList;
}
@Transactional
public void saveGroupWithDesign(PanelGroupRequest request) {
//TODO 更新panelGroup 信息
if (StringUtils.isEmpty(request.getId())) {
request.setId(UUID.randomUUID().toString());
request.setCreateTime(System.currentTimeMillis());
panelGroupMapper.insert(request);
} else {
panelGroupMapper.updateByPrimaryKey(request);
}
//TODO 更新panelDesign 信息
String panelId = request.getId();
Assert.notNull(panelId,"panelId should not be null");
//清理原有design
extPanelDesignMapper.deleteByPanelId(panelId);
//保存view 或者component design
Optional.ofNullable(request.getPanelDesigns()).orElse(new ArrayList<>()).stream().forEach(panelDesignDTO -> {
if(panelDesignDTO.isKeepFlag()) {
String componentId = "";
if(StringUtils.equals(PanelConstants.COMPONENT_TYPE_VIEW,panelDesignDTO.getComponentType())){
componentId = panelDesignDTO.getChartView().getId();
}else{
//预留 公共组件id获取
componentId = "";
}
panelDesignDTO.setPanelId(panelId);
panelDesignDTO.setComponentId(componentId);
panelDesignDTO.setUpdateTime(System.currentTimeMillis());
panelDesignMapper.insertSelective(panelDesignDTO);
}
});
}
}