From 68fb0790ddd3051a5dce856a91bdc7cf63f770d0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 19 Mar 2022 13:14:57 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=87=87=E9=9B=86=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.25__caiji_resi.sql | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__caiji_resi.sql diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__caiji_resi.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__caiji_resi.sql new file mode 100644 index 0000000000..e015975efa --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__caiji_resi.sql @@ -0,0 +1,42 @@ +CREATE TABLE `ic_resi_collect` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `ORIGIN` varchar(32) NOT NULL COMMENT '内部:internal;外部:external。', + `GRID_ID` varchar(64) DEFAULT NULL COMMENT '网格ID', + `AGENCY_ID` varchar(64) DEFAULT NULL COMMENT '组织Id', + `PIDS` varchar(255) DEFAULT NULL COMMENT '组织的pids', + `VILLAGE_ID` varchar(64) DEFAULT NULL COMMENT '所属小区ID;', + `BUILD_ID` varchar(64) DEFAULT NULL COMMENT '所属楼宇Id', + `UNIT_ID` varchar(64) DEFAULT NULL COMMENT '单元id', + `HOME_ID` varchar(64) DEFAULT NULL COMMENT '所属家庭Id', + `ADDRESS` varchar(255) NOT NULL COMMENT '详细地址', + `HOUSE_TYPE` varchar(1) NOT NULL COMMENT '1自由0租住', + `HOUSE_HOLDER_NAME` varchar(32) NOT NULL COMMENT '户主姓名', + `TOTAL_RESI` int(11) NOT NULL COMMENT '居住成员人数', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民信息采集表'; + + +CREATE TABLE `ic_resi_member` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id customer.id', + `IC_RESI_COLLECT_ID` varchar(64) NOT NULL COMMENT 'ic_resi_colllect.id', + `NAME` varchar(32) NOT NULL COMMENT '居住成员1姓名', + `ID_NUM` varchar(32) NOT NULL COMMENT '居住成员1身份证号', + `MOBILE` varchar(32) NOT NULL COMMENT '居住成员1手机号', + `HE_SUAN_COUNT` varchar(32) NOT NULL COMMENT '居住成员1是否参加几轮全员核算检测,数字1-10', + `YMJZ` int(11) NOT NULL COMMENT '居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种;', + `DEL_FLAG` int(11) NOT NULL DEFAULT '0' COMMENT '删除标识 0.未删除 1.已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='居民信息成员表'; \ No newline at end of file From 4cbccbca192069badf46308d593e640783d956dc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 19 Mar 2022 13:18:50 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E5=B1=85=E6=B0=91=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=87=87=E9=9B=86=E8=A1=A826?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{V0.0.25__caiji_resi.sql => V0.0.26__caiji_resi.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-user/epmet-user-server/src/main/resources/db/migration/{V0.0.25__caiji_resi.sql => V0.0.26__caiji_resi.sql} (100%) diff --git a/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__caiji_resi.sql b/epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.26__caiji_resi.sql similarity index 100% rename from epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.25__caiji_resi.sql rename to epmet-user/epmet-user-server/src/main/resources/db/migration/V0.0.26__caiji_resi.sql From 793cec8d684184d191ef908d55e381247b874a48 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 19 Mar 2022 13:59:12 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E6=88=90=E5=91=98=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/IcResiCollectMemFormDTO.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 7d6d1743af..ec40590451 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -2,6 +2,7 @@ package com.epmet.dto.form; import lombok.Data; +import javax.validation.constraints.NotBlank; import java.io.Serializable; @Data @@ -13,25 +14,30 @@ public class IcResiCollectMemFormDTO implements Serializable { /** * 居住成员1姓名 */ + @NotBlank(message = "姓名", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String name; /** * 居住成员1身份证号 */ + @NotBlank(message = "身份证号", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String idNum; /** * 居住成员1手机号 */ + @NotBlank(message = "手机号", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String mobile; /** * 居住成员1是否参加几轮全员核算检测,数字1-10 */ + @NotBlank(message = "核算检测情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String heSuanCount; /** * 居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种; */ + @NotBlank(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private Integer ymjz; } From 6f091f414c28ff4b06b528d60eaa7d2bee8f2b0f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 19 Mar 2022 14:05:50 +0800 Subject: [PATCH 04/15] notnull --- .../main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index ec40590451..5285b29d8b 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; @Data @@ -38,6 +39,6 @@ public class IcResiCollectMemFormDTO implements Serializable { /** * 居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种; */ - @NotBlank(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private Integer ymjz; } From 014aff5953ad56decc8370620acc9a0bf3493ddf Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 19 Mar 2022 14:11:09 +0800 Subject: [PATCH 05/15] 1 --- .../java/com/epmet/dto/form/IcResiCollectMemFormDTO.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 5285b29d8b..4490b9357c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -15,19 +15,19 @@ public class IcResiCollectMemFormDTO implements Serializable { /** * 居住成员1姓名 */ - @NotBlank(message = "姓名", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + @NotBlank(message = "姓名不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String name; /** * 居住成员1身份证号 */ - @NotBlank(message = "身份证号", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + @NotBlank(message = "身份证号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String idNum; /** * 居住成员1手机号 */ - @NotBlank(message = "手机号", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + @NotBlank(message = "手机号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String mobile; /** From edccc24487af19cda8ac95487d278849d030a9e8 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Sat, 19 Mar 2022 14:23:05 +0800 Subject: [PATCH 06/15] encode --- .../src/main/java/com/epmet/controller/AgencyController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 2f0d44a99b..4fab834a76 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -423,7 +423,7 @@ public class AgencyController { .concat("type=").concat(type).concat(StrConstant.AND_MARK) .concat("userId=").concat(tokenDto.getUserId()) .concat(StrConstant.AND_MARK).concat(String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli())); - BufferedImage image = BarcodeUtils.drawQRImage(name, url); + BufferedImage image = BarcodeUtils.drawQRImage(name, URLEncoder.encode(url,StrConstant.UTF_8)); //BufferedImage 转 InputStream ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream); From 0b53e6e03250837ff1c0baf0595949754802e7d3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Sat, 19 Mar 2022 14:31:36 +0800 Subject: [PATCH 07/15] name encode --- .../src/main/java/com/epmet/controller/AgencyController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 4fab834a76..fa337b1fd2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -418,12 +418,12 @@ public class AgencyController { String url = EnvEnum.getCurrentEnv().getUrl().replace("api/", StrConstant.EPMETY_STR) .concat("epmet-oper-gov/#/caiji/") .concat(id).concat("?") - .concat("name=").concat(name).concat(StrConstant.AND_MARK) + .concat("name=").concat(URLEncoder.encode(name,StrConstant.UTF_8)).concat(StrConstant.AND_MARK) .concat("customerId=").concat(tokenDto.getCustomerId()).concat(StrConstant.AND_MARK) .concat("type=").concat(type).concat(StrConstant.AND_MARK) .concat("userId=").concat(tokenDto.getUserId()) .concat(StrConstant.AND_MARK).concat(String.valueOf(LocalDateTime.now().toInstant(ZoneOffset.of("+8")).toEpochMilli())); - BufferedImage image = BarcodeUtils.drawQRImage(name, URLEncoder.encode(url,StrConstant.UTF_8)); + BufferedImage image = BarcodeUtils.drawQRImage(name, url); //BufferedImage 转 InputStream ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream); From 130f22d087075268519d004c2953fe460ecdfef8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 19 Mar 2022 19:25:39 +0800 Subject: [PATCH 08/15] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=B9=B6=E8=AE=BE=E7=BD=AE=E6=96=87=E5=AD=97=E9=97=B4?= =?UTF-8?q?=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-commons/epmet-commons-tools/pom.xml | 4 +-- .../commons/tools/utils/BarcodeUtils.java | 2 +- .../epmet/controller/AgencyController.java | 28 +++++++++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/pom.xml b/epmet-commons/epmet-commons-tools/pom.xml index 7542899ad0..7f1fb8e728 100644 --- a/epmet-commons/epmet-commons-tools/pom.xml +++ b/epmet-commons/epmet-commons-tools/pom.xml @@ -169,13 +169,13 @@ com.google.zxing core - 3.3.2 + 3.4.1 com.google.zxing javase - 3.3.2 + 3.4.1 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java index ee5369b3af..07af293c07 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java @@ -95,7 +95,7 @@ public class BarcodeUtils { //x开始的位置:(图片宽度-字体大小*字的个数)/2 int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2; //y开始的位置:图片高度-(图片高度-图片宽度)/2 - int startY = HEIGHT - (HEIGHT - WIDTH) / 2; + int startY = HEIGHT - (HEIGHT - WIDTH) / 2+ FONTSIZE; int imageW = outImage.getWidth(); int imageH = outImage.getHeight(); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index fa337b1fd2..e7396e96f8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -17,7 +17,6 @@ package com.epmet.controller; -import com.alibaba.fastjson.JSONObject; import com.epmet.commons.rocketmq.messages.OrgOrStaffMQMsg; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.RequirePermission; @@ -43,12 +42,7 @@ import com.epmet.send.SendMqMsgUtil; import com.epmet.service.AgencyService; import com.epmet.service.CustomerAgencyService; import com.epmet.service.IcNeighborHoodService; -import com.google.zxing.BarcodeFormat; -import com.google.zxing.EncodeHintType; -import com.google.zxing.MultiFormatWriter; -import com.google.zxing.WriterException; -import com.google.zxing.client.j2se.MatrixToImageWriter; -import com.google.zxing.common.BitMatrix; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -60,8 +54,6 @@ import javax.servlet.http.HttpServletResponse; import java.awt.image.BufferedImage; import java.io.*; import java.net.URLEncoder; -import java.nio.file.FileSystems; -import java.nio.file.Path; import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.HashMap; @@ -450,4 +442,22 @@ public class AgencyController { } } + public static void main(String[] args) { + try { + BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区中国国歌过过过过过所多对方水电费是的发生的", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111"); + //BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区", "erId=72d331139a5012b6bba18b40029a2755&123123123111"); + //BufferedImage image2 = BarcodeUtils.getQRCode("小崽子社区", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111"); + //BufferedImage 转 InputStream + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream); + ImageIO.write(image, "png", imageOutput); + InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); + String s = "/Users/liujianjun/Downloads/t.png"; + File file= new File(s); + FileUtils.copyInputStreamToFile(inputStream, file); + } catch (Exception e) { + e.printStackTrace(); + } + } + } From 8087817caf5833643366b7588300d46ae052d541 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 19 Mar 2022 19:39:41 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E4=BA=8C=E7=BB=B4=E7=A0=81=E5=8D=87?= =?UTF-8?q?=E7=BA=A7=E5=B9=B6=E8=AE=BE=E7=BD=AE=E6=96=87=E5=AD=97=E9=97=B4?= =?UTF-8?q?=E8=B7=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/utils/BarcodeUtils.java | 30 +++++++++++-------- .../epmet/controller/AgencyController.java | 18 +---------- 2 files changed, 19 insertions(+), 29 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java index 07af293c07..2f890c9e0f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/BarcodeUtils.java @@ -1,13 +1,5 @@ package com.epmet.commons.tools.utils; -/** - * desc: - * - * @author: LiuJanJun - * @date: 2022/3/18 11:57 上午 - * @version: 1.0 - */ - import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; @@ -28,7 +20,6 @@ import java.io.IOException; import java.util.HashMap; /** - * Author 程鹏 * Date: 2021/08/27 16:01 * Description:二维码生成工具类 */ @@ -95,7 +86,7 @@ public class BarcodeUtils { //x开始的位置:(图片宽度-字体大小*字的个数)/2 int startX = (WIDTH - (FONTSIZE * pressText.length())) / 2; //y开始的位置:图片高度-(图片高度-图片宽度)/2 - int startY = HEIGHT - (HEIGHT - WIDTH) / 2+ FONTSIZE; + int startY = HEIGHT - (HEIGHT - WIDTH) / 2 + FONTSIZE; int imageW = outImage.getWidth(); int imageH = outImage.getHeight(); @@ -169,9 +160,24 @@ public class BarcodeUtils { } else { return new String(btf, 0, len - 1, "GBK"); } - } - + /*public static void main(String[] args) { + try { + BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区中国国歌过过过过过所多对方水电费是的发生的", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111"); + //BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区", "erId=72d331139a5012b6bba18b40029a2755&123123123111"); + //BufferedImage image2 = BarcodeUtils.getQRCode("小崽子社区", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111"); + //BufferedImage 转 InputStream + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream); + ImageIO.write(image, "png", imageOutput); + InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); + String s = "/Users/liujianjun/Downloads/t.png"; + File file= new File(s); + FileUtils.copyInputStreamToFile(inputStream, file); + } catch (Exception e) { + e.printStackTrace(); + } + }*/ } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index e7396e96f8..2279f38fc1 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -442,22 +442,6 @@ public class AgencyController { } } - public static void main(String[] args) { - try { - BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区中国国歌过过过过过所多对方水电费是的发生的", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111"); - //BufferedImage image = BarcodeUtils.drawQRImage("小崽子社区", "erId=72d331139a5012b6bba18b40029a2755&123123123111"); - //BufferedImage image2 = BarcodeUtils.getQRCode("小崽子社区", "https://epmet-cloud.elinkservice.cn/epmet-oper-gov/#/caiji/b058eb82d65d922fec9dc84f0348fc6a?name=%E5%B0%8F%E5%AF%A8%E5%AD%90%E7%A4%BE%E5%8C%BA&customerId=3fdd0380deff5b30f45376cdf995d1c1&type=community&userId=72d331139a5012b6bba18b40029a2755&123123123111"); - //BufferedImage 转 InputStream - ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); - ImageOutputStream imageOutput = ImageIO.createImageOutputStream(byteArrayOutputStream); - ImageIO.write(image, "png", imageOutput); - InputStream inputStream = new ByteArrayInputStream(byteArrayOutputStream.toByteArray()); - String s = "/Users/liujianjun/Downloads/t.png"; - File file= new File(s); - FileUtils.copyInputStreamToFile(inputStream, file); - } catch (Exception e) { - e.printStackTrace(); - } - } + } From 666971bdc99630ffab0f9118d1e3efe60bc3bdf2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 21 Mar 2022 09:04:47 +0800 Subject: [PATCH 10/15] =?UTF-8?q?=E6=88=90=E5=91=98=E5=8F=AA=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=A7=93=E5=90=8D=E8=BA=AB=E4=BB=BD=E8=AF=81=E5=8F=B7?= =?UTF-8?q?=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/IcResiCollectMemFormDTO.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 4490b9357c..72096f2b36 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -3,7 +3,6 @@ package com.epmet.dto.form; import lombok.Data; import javax.validation.constraints.NotBlank; -import javax.validation.constraints.NotNull; import java.io.Serializable; @Data @@ -27,18 +26,18 @@ public class IcResiCollectMemFormDTO implements Serializable { /** * 居住成员1手机号 */ - @NotBlank(message = "手机号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + // @NotBlank(message = "手机号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String mobile; /** * 居住成员1是否参加几轮全员核算检测,数字1-10 */ - @NotBlank(message = "核算检测情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + // @NotBlank(message = "核算检测情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String heSuanCount; /** * 居住成员1新冠疫苗接种情况;1:已全程接种;2:未全程接种;0未接种; */ - @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + // @NotNull(message = "疫苗接种情况不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private Integer ymjz; } From 671b754a8ce14ae66083035b8b0a02b64752c9a8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 21 Mar 2022 09:15:29 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=81=9A=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/form/IcResiCollectMemFormDTO.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 72096f2b36..823e76b4c9 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -5,6 +5,10 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +/** + * 家庭成员信息 + * 前端做校验 + */ @Data public class IcResiCollectMemFormDTO implements Serializable { /** @@ -14,13 +18,13 @@ public class IcResiCollectMemFormDTO implements Serializable { /** * 居住成员1姓名 */ - @NotBlank(message = "姓名不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + // @NotBlank(message = "姓名不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String name; /** * 居住成员1身份证号 */ - @NotBlank(message = "身份证号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) + // @NotBlank(message = "身份证号不能为空", groups = {IcResiCollectFormDTO.InternalShowGroup.class, IcResiCollectFormDTO.ExternalShowGroup.class}) private String idNum; /** From 8930f00674de03e1109a05603a88d187092fa136 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 21 Mar 2022 09:18:01 +0800 Subject: [PATCH 12/15] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=81=9A=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java index 823e76b4c9..2dccf23b59 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/IcResiCollectMemFormDTO.java @@ -2,7 +2,6 @@ package com.epmet.dto.form; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.io.Serializable; /** From bec8cb2afe4ada2ab2101baae8833cc637a5043e Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 21 Mar 2022 10:01:22 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E9=87=87=E9=9B=86=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/form/CollectListFormDTO.java | 4 +--- .../com/epmet/service/impl/IcResiCollectServiceImpl.java | 3 --- .../src/main/resources/mapper/IcResiCollectDao.xml | 9 --------- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java index ae5ec4bacb..8c089ae331 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java @@ -24,9 +24,7 @@ public class CollectListFormDTO implements Serializable { private Integer pageSize; private String orgId; - private String neighborHoodId; - private String buildingId; - private String houseId; + private String address; /** diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java index 4037180bf0..fc714f2912 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java @@ -86,9 +86,6 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl getCollectList(CollectListFormDTO formDTO) { PageData result = new PageData<>(new ArrayList<>(), 0); if (StringUtils.isBlank(formDTO.getOrgId()) && - StringUtils.isBlank(formDTO.getNeighborHoodId()) && - StringUtils.isBlank(formDTO.getBuildingId()) && - StringUtils.isBlank(formDTO.getHouseId()) && StringUtils.isBlank(formDTO.getAddress()) && StringUtils.isBlank(formDTO.getStartDate()) && StringUtils.isBlank(formDTO.getEndDate()) ){ diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml index 7f2c5a9a4d..0be0e43c13 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiCollectDao.xml @@ -30,15 +30,6 @@ AND CONCAT(c.PIDS,':',c.AGENCY_ID) LIKE CONCAT('%',#{orgId},'%') - - AND c.VILLAGE_ID = #{neighborHoodId} - - - AND c.BUILD_ID = #{buildingId} - - - AND c.HOME_ID = #{houseId} - AND c.ADDRESS LIKE CONCAT('%',#{address},'%') From f06c7b607f3f97a76798bb7e1d8aa17f3a558723 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 21 Mar 2022 15:26:51 +0800 Subject: [PATCH 14/15] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E7=A4=BE=E5=8C=BAlist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/CommunityListResultDTO.java | 20 +++++++++++++++ .../epmet/controller/AgencyController.java | 12 +++++++-- .../java/com/epmet/dao/CustomerAgencyDao.java | 10 ++++++++ .../java/com/epmet/service/AgencyService.java | 25 ++++++------------- .../epmet/service/impl/AgencyServiceImpl.java | 16 ++++++++++++ .../resources/mapper/CustomerAgencyDao.xml | 12 +++++++++ 6 files changed, 76 insertions(+), 19 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java new file mode 100644 index 0000000000..2e080d97db --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/CommunityListResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2022/3/21 15:11 + * @DESC + */ +@Data +public class CommunityListResultDTO implements Serializable { + + private static final long serialVersionUID = 4336149113821131764L; + + private String orgId; + + private String orgName; +} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 2279f38fc1..f796f63a75 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -442,6 +442,14 @@ public class AgencyController { } } - - + /** + * Desc: 查询工作人员所属组织下的所有社区 + * @param tokenDto + * @author zxc + * @date 2022/3/21 15:13 + */ + @PostMapping("community-list") + public Result> getCommunityList(@LoginUser TokenDto tokenDto){ + return new Result>().ok(agencyService.getCommunityList(tokenDto)); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index fafb2d474d..5e7cd8713a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -306,5 +306,15 @@ public interface CustomerAgencyDao extends BaseDao { OrgMobileResultDTO getAgencyMobile(@Param("gridId") String gridId); int updateSubAgencyAreaCodeById(@Param("customerId")String customerId, @Param("agencyId")String agencyId, @Param("operateUserId") String operateUserId); + + /** + * Desc: 查询组织下的社区 + * @param customerId + * @param agencyId + * @author zxc + * @date 2022/3/21 15:23 + */ + List getCommunityList(@Param("customerId")String customerId, @Param("agencyId")String agencyId); + } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java index bacb45d855..629adcc17a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/AgencyService.java @@ -1,20 +1,3 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - package com.epmet.service; import com.epmet.commons.tools.security.dto.TokenDto; @@ -156,4 +139,12 @@ public interface AgencyService { */ List getSonAgencyId(String orgId,String type); + /** + * Desc: 查询工作人员所属组织下的所有社区 + * @param tokenDto + * @author zxc + * @date 2022/3/21 15:13 + */ + List getCommunityList(TokenDto tokenDto); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index c20fd83965..00dc182535 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -798,6 +798,22 @@ public class AgencyServiceImpl implements AgencyService { return new ArrayList<>(); } + /** + * Desc: 查询工作人员所属组织下的所有社区 + * @param tokenDto + * @author zxc + * @date 2022/3/21 15:13 + */ + @Override + public List getCommunityList(TokenDto tokenDto) { + CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + if (null == staffInfo){ + throw new EpmetException("未查询到工作人员信息"+staffInfo.getStaffId()); + } + String agencyId = staffInfo.getAgencyId(); + return customerAgencyDao.getCommunityList(tokenDto.getCustomerId(), agencyId); + } + private CustomerAgencyEntity constructInsertEntity(AddAgencyV2FormDTO formDTO, CustomerAgencyDTO parent) { CustomerAgencyEntity insertEntity = ConvertUtils.sourceToTarget(formDTO, CustomerAgencyEntity.class); insertEntity.setOrganizationName(formDTO.getAgencyName()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 2cd7210dc5..1e8792cab6 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -733,6 +733,18 @@ AND cg.id = #{gridId} + + + UPDATE customer_agency SET AREA_CODE = '', From 6e2620420bbdee32ec192cfc90dc2171dcd09450 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 21 Mar 2022 18:48:11 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=B1=85=E6=B0=91?= =?UTF-8?q?=E6=94=B6=E9=9B=86=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/CollectListFormDTO.java | 12 +---- .../dto/result/CollectListExcelResultDTO.java | 48 +++++++++++++++++++ .../CollectListMemberExcelResultDTO.java | 48 +++++++++++++++++++ .../dto/result/CollectListResultDTO.java | 16 +------ .../controller/IcResiCollectController.java | 40 ++++++++++++++++ .../impl/IcResiCollectServiceImpl.java | 13 +++-- 6 files changed, 148 insertions(+), 29 deletions(-) create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java create mode 100644 epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java index 8c089ae331..368db969c4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/CollectListFormDTO.java @@ -1,28 +1,20 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.dto.form.PageFormDTO; import lombok.Data; -import javax.validation.constraints.NotNull; -import java.io.Serializable; - /** * @Author zxc * @DateTime 2022/3/18 19:00 * @DESC */ @Data -public class CollectListFormDTO implements Serializable { +public class CollectListFormDTO extends PageFormDTO { private static final long serialVersionUID = 2106773724057183577L; public interface CollectListForm{} - @NotNull(message = "pageNo不能为空", groups = CollectListForm.class) - private Integer pageNo; - - @NotNull(message = "pageSize不能为空", groups = CollectListForm.class) - private Integer pageSize; - private String orgId; private String address; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java new file mode 100644 index 0000000000..f74e042b77 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListExcelResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2022/3/18 19:00 + * @DESC + */ +@Data +public class CollectListExcelResultDTO implements Serializable { + + private static final long serialVersionUID = -5659769436514116680L; + /** + * 户主姓名 + */ + @Excel(name = "户主姓名",width = 30, needMerge = true) + private String houseHolderName; + + /** + * 居住地址 + */ + @Excel(name = "居住地址",width = 40, needMerge = true) + private String address; + + /** + * 房屋类型,1:自有, 0:租住 + */ + @Excel(name = "房屋类型",replace = { "自有_1", "租住_2"}, width = 30, needMerge = true) + private String houseType; + + /** + * 居住人数 + */ + @Excel(name = "居住成员人数",width = 30, needMerge = true) + private Integer totalResi; + + @ExcelCollection(name="家庭成员") + private List listP = new ArrayList<>(); + + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java new file mode 100644 index 0000000000..319d11b8f0 --- /dev/null +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListMemberExcelResultDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.result; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2022/3/21 5:09 下午 + * @version: 1.0 + */ +@Data +public class CollectListMemberExcelResultDTO implements Serializable { + private static final long serialVersionUID = -4290962585956172531L; + /** + * 成员名字 + */ + @Excel(name = "成员姓名", width = 30) + private String memberName; + + /** + * 成员身份证 + */ + @Excel(name = "成员身份证号", width = 30) + private String memberIdNum; + + /** + * 成员电话 + */ + @Excel(name = "成员手机号", width = 30) + private String memberMobile; + + /** + * 核酸检测次数 + */ + @Excel(name = "参加几轮核酸检测", width = 30) + private String heSuanCount = "0"; + + /** + * 疫苗是否全程接种,1:全程接种,2:未全程接种,3:为接种 + */ + @Excel(name = "疫苗接种情况",replace = { "全程接种_1", "未全程接种_2", "未接种_3" }, width = 30) + private String ymjz; + +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java index 9edcfa4d8d..1d61469165 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CollectListResultDTO.java @@ -4,7 +4,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; -import java.util.ArrayList; import java.util.List; /** @@ -42,13 +41,6 @@ public class CollectListResultDTO implements Serializable { private List list; - public CollectListResultDTO() { - this.houseHolderName = ""; - this.address = ""; - this.houseType = "0"; - this.totalResi = 0; - this.list = new ArrayList<>(); - } @Data public static class CollectListMemberResultDTO{ @@ -77,12 +69,6 @@ public class CollectListResultDTO implements Serializable { */ private Integer ymjz; - public CollectListMemberResultDTO() { - this.memberName = ""; - this.memberIdNum = ""; - this.memberMobile = ""; - this.heSuanCount = "0"; - this.ymjz = 0; - } + } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java index ed1227c01e..fbe82fc561 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiCollectController.java @@ -2,12 +2,17 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.aop.NoRepeatSubmit; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CollectListFormDTO; import com.epmet.dto.form.IcResiCollectFormDTO; +import com.epmet.dto.result.CollectListExcelResultDTO; +import com.epmet.dto.result.CollectListMemberExcelResultDTO; import com.epmet.dto.result.CollectListResultDTO; import com.epmet.service.IcResiCollectService; import org.springframework.beans.factory.annotation.Autowired; @@ -16,6 +21,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; @@ -68,4 +75,37 @@ public class IcResiCollectController { return new Result>().ok(icResiCollectService.getCollectList(formDTO)); } + /** + * Desc: 查询采集居民信息 + * @param formDTO + * @param tokenDto + * @author zxc + * @date 2022/3/18 19:23 + */ + @PostMapping("export") + public void export(@RequestBody CollectListFormDTO formDTO, @LoginUser TokenDto tokenDto, HttpServletResponse response) throws Exception { + //ValidatorUtils.validateEntity(formDTO,CollectListFormDTO.CollectListForm.class); + //tokenDto.setUserId("73ae6280e46a6653a5605d51d5462725"); + //tokenDto.setCustomerId("45687aa479955f9d06204d415238f7cc"); + formDTO.setUserId(tokenDto.getUserId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setPage(false); + PageData collectList = icResiCollectService.getCollectList(formDTO); + List list = ConvertUtils.sourceToTarget(collectList.getList(),CollectListExcelResultDTO.class); + + collectList.getList().forEach(o->{ + List children = new ArrayList<>(); + o.getList().forEach(item->{ + CollectListMemberExcelResultDTO resultDTO = ConvertUtils.sourceToTarget(item, CollectListMemberExcelResultDTO.class); + resultDTO.setYmjz(item.getYmjz() == null? StrConstant.EPMETY_STR:String.valueOf(item.getYmjz())); + children.add(resultDTO); + }); + CollectListExcelResultDTO resultDTO = ConvertUtils.sourceToTarget(o, CollectListExcelResultDTO.class); + resultDTO.setListP(children); + list.add(resultDTO); + }); + + ExcelUtils.exportExcelToTarget(response, null, list, CollectListExcelResultDTO.class); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java index fc714f2912..e59318dbd6 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiCollectServiceImpl.java @@ -95,9 +95,14 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl pageList = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getCollectList(formDTO)); - result.setList(pageList.getList()); - result.setTotal(Integer.valueOf(String.valueOf(pageList.getTotal()))); + if (formDTO.isPage()){ + PageInfo pageList = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getCollectList(formDTO)); + result.setList(pageList.getList()); + result.setTotal(Integer.parseInt(String.valueOf(pageList.getTotal()))); + }else { + List collectList = baseDao.getCollectList(formDTO); + result.setList(collectList); + } return result; } @@ -132,4 +137,4 @@ public class IcResiCollectServiceImpl extends BaseServiceImpl