From b500a532b1aa8240d98d509d2e7d737fff81d930 Mon Sep 17 00:00:00 2001 From: ZhiJian <18625010203@163.com> Date: Sat, 20 Jul 2024 16:59:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=A7=86=E9=A2=91=E6=98=BE=E7=A4=BA,?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B2=BE=E5=BA=A6,=C3=A6=C2=B7=E6=93=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BD=9C=C3=A6;=E6=B7=BB=E5=8A=A0=E6=93=8D?= =?UTF-8?q?=E4=BD=9C=E6=89=8B=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cxxm/domain/entity/zftk/ZftkTask.java | 8 +++++ .../domain/entity/zftk/ZftkTaskExport.java | 8 +++++ .../ruoyi/cxxm/domain/entity/zt/ZtTask.java | 6 ++++ .../cxxm/domain/entity/zt/ZtTaskExport.java | 6 ++++ .../cxxm/domain/entity/zttb/ZttbTask.java | 5 +++ .../domain/entity/zttb/ZttbTaskExport.java | 6 ++++ .../cxxm/serializer/CustomMjSerialize.java | 29 +++++++++++++++++ ruoyi-ui/src/components/Map/index.vue | 2 +- ruoyi-ui/src/components/Map2/index.vue | 1 - ruoyi-ui/src/components/RuoYi/Doc/index.vue | 12 +++++-- ruoyi-ui/src/layout/components/Navbar.vue | 32 ++++++++++--------- .../src/views/cxxm/ztTask/detail/index.vue | 1 + .../src/views/cxxm/zttbTask/detail/index.vue | 1 + 13 files changed, 97 insertions(+), 20 deletions(-) create mode 100644 cxxm/src/main/java/com/ruoyi/cxxm/serializer/CustomMjSerialize.java diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTask.java b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTask.java index 92200226..b7d94f7a 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTask.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTask.java @@ -4,9 +4,11 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.cxxm.serializer.CustomMjSerialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.baomidou.mybatisplus.annotation.IdType; @@ -78,6 +80,7 @@ public class ZftkTask extends BaseEntity { */ @Excel(name = "地块面积") @ApiModelProperty(value = "地块面积") + @JsonSerialize(using = CustomMjSerialize.class) private String dkmj; @@ -86,6 +89,7 @@ public class ZftkTask extends BaseEntity { */ @Excel(name = "农用地面积") @ApiModelProperty(value = "农用地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String nydmj; @@ -94,6 +98,7 @@ public class ZftkTask extends BaseEntity { */ @Excel(name = "耕地面积") @ApiModelProperty(value = "耕地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String gdmj; @@ -102,6 +107,7 @@ public class ZftkTask extends BaseEntity { */ @Excel(name = "建设用地面积") @ApiModelProperty(value = "建设用地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String jsydmj; @@ -110,6 +116,7 @@ public class ZftkTask extends BaseEntity { */ @Excel(name = "未利用用地面积") @ApiModelProperty(value = "未利用用地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String wlydmj; /** @@ -117,6 +124,7 @@ public class ZftkTask extends BaseEntity { */ @Excel(name = "永久基本农田面积") @ApiModelProperty(value = "永久基本农田面积") + @JsonSerialize(using = CustomMjSerialize.class) private String yjjbntmj; diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTaskExport.java b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTaskExport.java index 76cfcbe8..0968f7d4 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTaskExport.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zftk/ZftkTaskExport.java @@ -4,8 +4,10 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.cxxm.serializer.CustomMjSerialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -78,6 +80,7 @@ public class ZftkTaskExport extends BaseEntity { */ @Excel(name = "地块面积",needMerge = true) @ApiModelProperty(value = "地块面积") + @JsonSerialize(using = CustomMjSerialize.class) private String dkmj; @@ -86,6 +89,7 @@ public class ZftkTaskExport extends BaseEntity { */ @Excel(name = "农用地面积",needMerge = true) @ApiModelProperty(value = "农用地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String nydmj; @@ -94,6 +98,7 @@ public class ZftkTaskExport extends BaseEntity { */ @Excel(name = "耕地面积",needMerge = true) @ApiModelProperty(value = "耕地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String gdmj; @@ -102,6 +107,7 @@ public class ZftkTaskExport extends BaseEntity { */ @Excel(name = "建设用地面积",needMerge = true) @ApiModelProperty(value = "建设用地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String jsydmj; @@ -110,6 +116,7 @@ public class ZftkTaskExport extends BaseEntity { */ @Excel(name = "未利用用地面积",needMerge = true) @ApiModelProperty(value = "未利用用地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String wlydmj; /** @@ -117,6 +124,7 @@ public class ZftkTaskExport extends BaseEntity { */ @Excel(name = "永久基本农田面积",needMerge = true) @ApiModelProperty(value = "永久基本农田面积") + @JsonSerialize(using = CustomMjSerialize.class) private String yjjbntmj; diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTask.java b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTask.java index 7c3f1bb4..e46136b3 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTask.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTask.java @@ -4,9 +4,11 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.cxxm.serializer.CustomMjSerialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.baomidou.mybatisplus.annotation.IdType; @@ -94,6 +96,7 @@ public class ZtTask extends BaseEntity { */ @Excel(name = "图标面积") @ApiModelProperty(value = "图标面积") + @JsonSerialize(using = CustomMjSerialize.class) private String tbmj; @@ -102,6 +105,7 @@ public class ZtTask extends BaseEntity { */ @Excel(name = "耕地面积") @ApiModelProperty(value = "耕地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String gdmj; @@ -110,6 +114,7 @@ public class ZtTask extends BaseEntity { */ @Excel(name = "基本农田面积") @ApiModelProperty(value = "基本农田面积") + @JsonSerialize(using = CustomMjSerialize.class) private String jbntmj; @@ -134,6 +139,7 @@ public class ZtTask extends BaseEntity { */ @Excel(name = "恢复原貌面积") @ApiModelProperty(value = "恢复原貌面积") + @JsonSerialize(using = CustomMjSerialize.class) private String hfymmj; diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTaskExport.java b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTaskExport.java index a04a6c8e..9c761b85 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTaskExport.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zt/ZtTaskExport.java @@ -3,9 +3,11 @@ package com.ruoyi.cxxm.domain.entity.zt; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.cxxm.domain.entity.zftk.ZftkCheckExport; +import com.ruoyi.cxxm.serializer.CustomMjSerialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -94,6 +96,7 @@ public class ZtTaskExport extends BaseEntity { */ @Excel(name = "图标面积",needMerge = true) @ApiModelProperty(value = "图标面积") + @JsonSerialize(using = CustomMjSerialize.class) private String tbmj; @@ -102,6 +105,7 @@ public class ZtTaskExport extends BaseEntity { */ @Excel(name = "耕地面积",needMerge = true) @ApiModelProperty(value = "耕地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String gdmj; @@ -110,6 +114,7 @@ public class ZtTaskExport extends BaseEntity { */ @Excel(name = "基本农田面积",needMerge = true) @ApiModelProperty(value = "基本农田面积") + @JsonSerialize(using = CustomMjSerialize.class) private String jbntmj; @@ -134,6 +139,7 @@ public class ZtTaskExport extends BaseEntity { */ @Excel(name = "恢复原貌面积",needMerge = true) @ApiModelProperty(value = "恢复原貌面积") + @JsonSerialize(using = CustomMjSerialize.class) private String hfymmj; diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTask.java b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTask.java index c81fc88c..28c967c9 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTask.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTask.java @@ -4,9 +4,11 @@ import java.util.Date; import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; +import com.ruoyi.cxxm.serializer.CustomMjSerialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import com.baomidou.mybatisplus.annotation.IdType; @@ -94,6 +96,7 @@ public class ZttbTask extends BaseEntity { */ @Excel(name = "图斑面积") @ApiModelProperty(value = "图斑面积") + @JsonSerialize(using = CustomMjSerialize.class) private String tbmj; @@ -102,6 +105,7 @@ public class ZttbTask extends BaseEntity { */ @Excel(name = "耕地面积") @ApiModelProperty(value = "耕地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String gdmj; @@ -110,6 +114,7 @@ public class ZttbTask extends BaseEntity { */ @Excel(name = "基本农田面积") @ApiModelProperty(value = "基本农田面积") + @JsonSerialize(using = CustomMjSerialize.class) private String jbntmj; diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTaskExport.java b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTaskExport.java index 85561349..ba9bc0ae 100644 --- a/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTaskExport.java +++ b/cxxm/src/main/java/com/ruoyi/cxxm/domain/entity/zttb/ZttbTaskExport.java @@ -3,9 +3,11 @@ package com.ruoyi.cxxm.domain.entity.zttb; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.cxxm.domain.entity.zt.ZtCheckExport; +import com.ruoyi.cxxm.serializer.CustomMjSerialize; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -94,6 +96,7 @@ public class ZttbTaskExport extends BaseEntity { */ @Excel(name = "图标面积",needMerge = true) @ApiModelProperty(value = "图标面积") + @JsonSerialize(using = CustomMjSerialize.class) private String tbmj; @@ -102,6 +105,7 @@ public class ZttbTaskExport extends BaseEntity { */ @Excel(name = "耕地面积",needMerge = true) @ApiModelProperty(value = "耕地面积") + @JsonSerialize(using = CustomMjSerialize.class) private String gdmj; @@ -110,6 +114,7 @@ public class ZttbTaskExport extends BaseEntity { */ @Excel(name = "基本农田面积",needMerge = true) @ApiModelProperty(value = "基本农田面积") + @JsonSerialize(using = CustomMjSerialize.class) private String jbntmj; @@ -134,6 +139,7 @@ public class ZttbTaskExport extends BaseEntity { */ @Excel(name = "恢复原貌面积",needMerge = true) @ApiModelProperty(value = "恢复原貌面积") + @JsonSerialize(using = CustomMjSerialize.class) private String hfymmj; diff --git a/cxxm/src/main/java/com/ruoyi/cxxm/serializer/CustomMjSerialize.java b/cxxm/src/main/java/com/ruoyi/cxxm/serializer/CustomMjSerialize.java new file mode 100644 index 00000000..57c1d896 --- /dev/null +++ b/cxxm/src/main/java/com/ruoyi/cxxm/serializer/CustomMjSerialize.java @@ -0,0 +1,29 @@ +package com.ruoyi.cxxm.serializer; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; + +import java.io.IOException; +import java.text.DecimalFormat; + +public class CustomMjSerialize extends JsonSerializer { + + private DecimalFormat df = new DecimalFormat("0.0000"); + + @Override + public void serialize(String value, JsonGenerator jsonGenerator, SerializerProvider serializerProvider) throws IOException { + if (value == null || value.equals(" ")) { + value = "0"; + } + try { + if (value.contains(".")) { + value = df.format(Double.parseDouble(value)); + } + } catch (Exception e) { + + } finally { + jsonGenerator.writeString(value); + } + } +} \ No newline at end of file diff --git a/ruoyi-ui/src/components/Map/index.vue b/ruoyi-ui/src/components/Map/index.vue index 697f3ad7..5f269fa0 100644 --- a/ruoyi-ui/src/components/Map/index.vue +++ b/ruoyi-ui/src/components/Map/index.vue @@ -3,7 +3,7 @@
-
图层
+
测距
测面
清除
diff --git a/ruoyi-ui/src/components/Map2/index.vue b/ruoyi-ui/src/components/Map2/index.vue index 697f3ad7..46694006 100644 --- a/ruoyi-ui/src/components/Map2/index.vue +++ b/ruoyi-ui/src/components/Map2/index.vue @@ -230,7 +230,6 @@ export default { .map-gj { padding: 5px 10px; border: 1px solid #999999; - } .map-gj:last-child { diff --git a/ruoyi-ui/src/components/RuoYi/Doc/index.vue b/ruoyi-ui/src/components/RuoYi/Doc/index.vue index cc829b24..b58effbe 100644 --- a/ruoyi-ui/src/components/RuoYi/Doc/index.vue +++ b/ruoyi-ui/src/components/RuoYi/Doc/index.vue @@ -9,13 +9,19 @@ export default { name: 'RuoYiDoc', data() { return { - url: 'http://doc.ruoyi.vip/ruoyi-vue' + url: 'http://doc.ruoyi.vip/ruoyi-vue', + zjDoc: process.env.VUE_APP_BASE_API + "/profile/common/州级账号Web平台操作指导手册.pdf", + sjDoc: process.env.VUE_APP_BASE_API + "/profile/common/市、县级账号Web平台操作指导手册.pdf", } }, methods: { goto() { - window.open(this.url) + var gotoURL = this.sjDoc; + if(this.$auth.hasRoleOr(["admin", "zjgly"])){ + gotoURL = this.zjDoc + } + window.open(gotoURL) } } } - \ No newline at end of file + diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue index 6909ec76..04c392a1 100644 --- a/ruoyi-ui/src/layout/components/Navbar.vue +++ b/ruoyi-ui/src/layout/components/Navbar.vue @@ -1,26 +1,27 @@