springcloud_k8s_panzhihuazhihuishequ/common/pom.xml
@@ -164,6 +164,16 @@ </exclusion> </exclusions> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>3.1.0</version> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>3.1.0</version> </dependency> </dependencies> springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCorrectExcelListen.java
@@ -286,17 +286,17 @@ if (StringUtils.isNotEmpty(oneData.get(15))) { vo.setCensusRegister(oneData.get(15).trim()); } if (StringUtils.isEmpty(oneData.get(16))) { Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(16)); if (isOk.equals(-1)) { index++; ComMngPopulationCorrectMistakeExcelVO mistake = new ComMngPopulationCorrectMistakeExcelVO(); setMistake(oneData, mistake); mistake.setMistake("您填写的学历有误"); mistakes.add(mistake); continue; } vo.setCultureLevel(isOk); if (StringUtils.isNotEmpty(oneData.get(16))) { // Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(16)); // if (isOk.equals(-1)) { // index++; // ComMngPopulationCorrectMistakeExcelVO mistake = new ComMngPopulationCorrectMistakeExcelVO(); // setMistake(oneData, mistake); // mistake.setMistake("您填写的学历有误"); // mistakes.add(mistake); // continue; // } vo.setCultureLevel(oneData.get(16).trim()); } if (StringUtils.isNotEmpty(oneData.get(17))) { vo.setCorrectPersonCode(oneData.get(17).trim()); springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationMajorExcelListen.java
@@ -303,16 +303,16 @@ vo.setCustodyPerson(oneData.get(18).trim()); } if (StringUtils.isNotEmpty(oneData.get(19))) { Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(19)); if (isOk.equals(-1)) { index++; ComMngPopulationMajorMistakeExcelVO mistake = new ComMngPopulationMajorMistakeExcelVO(); setMistake(oneData, mistake); mistake.setMistake("您填写的与监护人关系有误"); mistakes.add(mistake); continue; } vo.setCustodyRelation(isOk); // Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(19)); // if (isOk.equals(-1)) { // index++; // ComMngPopulationMajorMistakeExcelVO mistake = new ComMngPopulationMajorMistakeExcelVO(); // setMistake(oneData, mistake); // mistake.setMistake("您填写的与监护人关系有误"); // mistakes.add(mistake); // continue; // } vo.setCustodyRelation(oneData.get(19).trim()); } if (StringUtils.isNotEmpty(oneData.get(20))) { vo.setCustodyCardNo(oneData.get(20).trim()); springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationRehabilitationExcelListen.java
@@ -308,17 +308,17 @@ vo.setMainRelatives(oneData.get(17).trim()); } if (StringUtils.isNotEmpty(oneData.get(18))) { Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(18)); if (isOk.equals(-1)) { index++; ComMngPopulationRehabilitationMistakeExcelVO mistake = new ComMngPopulationRehabilitationMistakeExcelVO(); setRehabilitationMistake(oneData, mistake); mistake.setMistake("您填写的与人员关系有误"); mistakes.add(mistake); continue; } vo.setPatientRelation(isOk); // Integer isOk = PopulRelationEnum.getCodeByName(oneData.get(18)); // if (isOk.equals(-1)) { // index++; // ComMngPopulationRehabilitationMistakeExcelVO mistake = // new ComMngPopulationRehabilitationMistakeExcelVO(); // setRehabilitationMistake(oneData, mistake); // mistake.setMistake("您填写的与人员关系有误"); // mistakes.add(mistake); // continue; // } vo.setPatientRelation(oneData.get(18).trim()); } if (StringUtils.isNotEmpty(oneData.get(19))) { vo.setRehabReasonAndType(oneData.get(19).trim()); springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationVeteransExcelListen.java
@@ -176,16 +176,16 @@ vo.setPhoto(oneData.get(6)); } if (StringUtils.isNotEmpty(oneData.get(7))) { Integer isOk = PopulRegiterNatureEnum.getCodeByName(oneData.get(7).trim()); if (isOk.equals(-1)) { index++; ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); setVeteransMistake(oneData, mistake); mistake.setMistake("您填写的户籍性质有误"); mistakes.add(mistake); continue; } vo.setRegiterNature(isOk); // Integer isOk = PopulRegiterNatureEnum.getCodeByName(oneData.get(7).trim()); // if (isOk.equals(-1)) { // index++; // ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); // setVeteransMistake(oneData, mistake); // mistake.setMistake("您填写的户籍性质有误"); // mistakes.add(mistake); // continue; // } vo.setRegiterNature(oneData.get(7).trim()); } if (StringUtils.isNotEmpty(oneData.get(8))) { vo.setCensusRegister(oneData.get(8).trim()); @@ -338,7 +338,7 @@ index++; ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); setVeteransMistake(oneData, mistake); mistake.setMistake("您填写的婚姻关系·有误"); mistake.setMistake("您填写的婚姻关系有误"); mistakes.add(mistake); continue; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ActivitySignVO.java
@@ -24,6 +24,8 @@ private String nickName; @ApiModelProperty("身份") private String identity; @ApiModelProperty("人群标签") private String tags; @ApiModelProperty("手机号") private String phone; @ApiModelProperty("报名时间") springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActRegistExcelVO.java
New file @@ -0,0 +1,36 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.annotations.ApiModel; import lombok.Data; import java.util.Date; /** * title: ComActActRegistExcelVO 社区活动签到表 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 记录和展示社区活动签到内容 * * @author txb * @date 2021/8/24 10:21 */ @Data @ApiModel("社区活动签到表") public class ComActActRegistExcelVO { @ExcelProperty(value = "姓名", index = 1) private String name; @ExcelProperty(value = "身份", index = 2) private String identity; @ExcelProperty(value = "电话", index = 4) private String phone; @ExcelProperty(value = "签到时间", index = 0) private Date createAt; @ExcelProperty(value = "人群标签", index = 3) private String tags; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActRegistVO.java
@@ -1,10 +1,6 @@ package com.panzhihua.common.model.vos.community; import javax.validation.constraints.Min; import com.fasterxml.jackson.annotation.JsonFormat; import com.panzhihua.common.validated.AddGroup; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -12,27 +8,61 @@ import java.util.Date; /** * @title: SignInActivityVO 活动签到 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 活动签到 * @author: hans * @date: 2021/08/25 14:10 * title: ComActActEvaluateDO 社区活动签到表 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 记录和展示社区活动签到内容 * * @author txb * @date 2021/8/24 10:21 */ @Data @ApiModel("活动签到") @ApiModel("社区活动签到表") public class ComActActRegistVO { @ApiModelProperty("活动签到主键") @ApiModelProperty("自增id") private Long id; @ApiModelProperty(value = "以什么身份报名活动 1 志愿者 0 普通居民", example = "1", required = true) @Min(value = 0, groups = {AddGroup.class}, message = "报名身份不能为空") private Integer isVolunteer; @ApiModelProperty(value = "活动主键", required = true) @Min(value = 1, groups = {AddGroup.class}, message = "活动主键不能为空") @ApiModelProperty("所属活动id") private Long activityId; @ApiModelProperty(value = "当前登录用户id", hidden = true) @ApiModelProperty("用户id, 和用户信息表的相关id关联") private Long userId; @ApiModelProperty("名字") private String name; @ApiModelProperty("用户昵称") private String nickName; @ApiModelProperty("身份") private String identity; @ApiModelProperty("人群标签") private String tags; @ApiModelProperty("手机号") private String phone; @ApiModelProperty("人员头像") private String imageUrl; @ApiModelProperty(value = "列表人员类型 1 普通居民 2 志愿者", hidden = true) private Integer type; @ApiModelProperty("签到时间") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date createAt; } @ApiModelProperty("是否是志愿者 0 否 1 是") private Integer isVolunteer; @ApiModelProperty("用户openid") private String openid; @ApiModelProperty(value = "分页-当前页数", example = "1") private Long pageNum = 1L; @ApiModelProperty(value = "分页-每页记录数", example = "10") private Long pageSize = 10L; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActSignExcelVO.java
New file @@ -0,0 +1,36 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import io.swagger.annotations.ApiModel; import lombok.Data; import java.util.Date; /** * title: ComActActSignExcelVO 社区活动报名名单 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 记录和展示社区活动报名名单 * * @author txb * @date 2021/8/24 10:21 */ @Data @ApiModel("社区活动签到表") public class ComActActSignExcelVO { @ExcelProperty(value = "姓名", index = 1) private String name; @ExcelProperty(value = "身份", index = 2) private String identity; @ExcelProperty(value = "电话", index = 4) private String phone; @ExcelProperty(value = "报名时间", index = 0) private Date createAt; @ExcelProperty(value = "人群标签", index = 3) private String tags; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComActActivityStatisticsVO.java
New file @@ -0,0 +1,91 @@ package com.panzhihua.common.model.vos.community; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * 社区活动数据统计返回参数 */ @Data @ApiModel("社区活动数据统计返回参数") public class ComActActivityStatisticsVO { /** * 应报名总人数 */ @ApiModelProperty("应报名总人数") private Integer signTotal; /** * 应报名总人数Str */ @ApiModelProperty("应报名总人数Str") private String signTotalStr; /** * 实际报名总人数 */ @ApiModelProperty("实际报名总人数") private Integer reallySignTotal; /** * 未报名报名总人数 */ @ApiModelProperty("未报名报名总人数") private Integer noSignTotal; /** * 未报名报名总人数Str */ @ApiModelProperty("未报名报名总人数Str") private String noSignTotalStr; /** * 报名总人数百分比 */ @ApiModelProperty("报名总人数百分比") private String signPersent; /** * 应签到总人数 */ @ApiModelProperty("应签到总人数") private Integer registTotal; /** * 实际签到总人数 */ @ApiModelProperty("实际签到总人数") private Integer reallyRegistTotal; /** * 未签到总人数 */ @ApiModelProperty("未签到总人数") private Integer noRegistTotal; /** * 签到总人数百分比 */ @ApiModelProperty("签到总人数百分比") private String registPersent; /** * 应评价总人数 */ @ApiModelProperty("应评价总人数") private Integer evaluateTotal; /** * 实际评价总人数 */ @ApiModelProperty("实际评价总人数") private Integer reallyEvaluateTotal; /** * 未评价总人数 */ @ApiModelProperty("未评价总人数") private Integer noEvaluateTotal; /** * 评价人数百分比 */ @ApiModelProperty("评价人数百分比") private String evaluatePersent; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComCorrectPopulationVO.java
@@ -240,7 +240,7 @@ * 学历 */ @ApiModelProperty("学历") private Integer cultureLevel; private String cultureLevel; /** * 社区矫正人员编号 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMajorPopulationVO.java
@@ -91,7 +91,7 @@ * 与监护人关系 */ @ApiModelProperty("与监护人关系") private Integer custodyRelation; private String custodyRelation; /** * 监护人公民身份号码 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationCorrectExcelVO.java
@@ -69,7 +69,7 @@ private String censusRegister; @ExcelProperty(value = "学历", index = 16) private Integer cultureLevel; private String cultureLevel; @ExcelProperty(value = "社区矫正人员编号", index = 17) private String correctPersonCode; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationMajorExcelVO.java
@@ -77,7 +77,7 @@ private String custodyPerson; @ExcelProperty(value = "与监护人关系", index = 19) private Integer custodyRelation; private String custodyRelation; @ExcelProperty(value = "监护人公民身份号码", index = 20) private String custodyCardNo; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationRehabilitationExcelVO.java
@@ -75,7 +75,7 @@ private String mainRelatives; @ExcelProperty(value = "与人员关系", index = 18) private Integer patientRelation; private String patientRelation; @ExcelProperty(value = "列管原因及类型", index = 19) private String rehabReasonAndType; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationVeteransExcelVO.java
@@ -41,8 +41,8 @@ @ExcelProperty(value = "照片", index = 6) private String photo; @ExcelProperty(value = "户籍性质(1.城镇户口 2.农村户口)", index = 7) private Integer regiterNature; @ExcelProperty(value = "户籍性质", index = 7) private String regiterNature; @ExcelProperty(value = "户口所在地", index = 8) private String censusRegister; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComRehabilitationPopulationVO.java
@@ -74,7 +74,7 @@ * 与人员关系 */ @ApiModelProperty("与人员关系") private Integer patientRelation; private String patientRelation; /** * 列管原因及类型 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComSwDangerReportExcelVO.java
@@ -1,6 +1,7 @@ package com.panzhihua.common.model.vos.community; import java.io.Serializable; import java.util.Date; import com.alibaba.excel.annotation.ExcelProperty; @@ -31,27 +32,57 @@ private String dangerType; /** * 状态 */ @ExcelProperty(value = "状态", index = 3) private String status; /** * 风险等级 */ @ExcelProperty(value = "风险等级", index = 3) @ExcelProperty(value = "风险等级", index = 4) private String dangerLevel; /** * 巡查人员 */ @ExcelProperty(value = "巡查人员", index = 4) private String personName; @ExcelProperty(value = "巡查人员", index = 5) private String ppersonName; /** * 联系电话 */ @ExcelProperty(value = "联系电话", index = 5) private String personPhone; @ExcelProperty(value = "联系电话", index = 6) private String ppersonPhone; /** * 填报时间 */ @ExcelProperty(value = "填报时间", index = 7) private Date createAt; /** * 备注 */ @ExcelProperty(value = "备注", index = 6) @ExcelProperty(value = "备注", index = 8) private String remark; /** * 整改人员 */ @ExcelProperty(value = "整改人员", index = 9) private String dpersonName; /** * 联系电话 */ @ExcelProperty(value = "联系电话", index = 10) private String dpersonPhone; /** * 整改时间 */ @ExcelProperty(value = "整改时间", index = 11) private Date rectifyTime; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComVeteransPopulationVO.java
@@ -89,10 +89,10 @@ private String photo; /** * 户籍性质(1.城镇户口 2.农村户口) * 户籍性质 */ @ApiModelProperty("户籍性质(1.城镇户口 2.农村户口)") private Integer regiterNature; @ApiModelProperty("户籍性质") private String regiterNature; /** * 入伍时间 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -324,6 +324,16 @@ R listActivitySign(@RequestBody ActivitySignVO activitySignVO); /** * description getSignLists 查询活动报名名单 * @param activitySignVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ @PostMapping("/activity/sign/getList") R getSignLists(@RequestBody ActivitySignVO activitySignVO); /** * description listActivityRegists 分页查询活动评价 * @param comActActEvaluateVO 活动评价vo * @return R 分页查询结果 @@ -331,17 +341,47 @@ * @date 2021/8/24 14:03 */ @PostMapping("/activity/evaluate/page") R pageActivityRegists(@RequestBody ComActActEvaluateVO comActActEvaluateVO); R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO); /** * description getEvaluateListsByIds 批量查询活动评价 * @param ids ids * description getEvaluateLists 查询活动评价 * @param comActActEvaluateVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ @PostMapping("/activity/evaluate/getList") R getEvaluateListsByIds(@RequestBody List<Long> ids); R getEvaluateLists(@RequestBody ComActActEvaluateVO comActActEvaluateVO); /** * description pageActivityRegists 分页查询活动签到 * @param comActActRegistVO 活动签到vo * @return R 分页查询结果 * @author txb * @date 2021/8/24 14:03 */ @PostMapping("/activity/regist/page") R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO); /** * description getRegistLists 查询活动签到 * @param comActActRegistVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/25 9:33 */ @PostMapping("/activity/regist/getList") R getRegistLists(@RequestBody ComActActRegistVO comActActRegistVO); /** * description activityStagistics 活动数据统计 * @param activityId 活动id * @return R 统计结果 * @author txb * @date 2021/8/25 13:33 */ @GetMapping("/activity/statistics") R activityStatistics(@RequestParam("activityId") Long activityId); /** * 活动报名名单 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/FileUtil.java
@@ -1,7 +1,8 @@ package com.panzhihua.common.utlis; import java.io.File; import java.io.InputStream; import java.io.*; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; public class FileUtil { @@ -32,4 +33,83 @@ public static File readUserHomeFile(String pathName) { return new File(System.getProperty("user.home") + File.separator + pathName); } /** * 压缩文件 * * @param sourceFilePath 源文件路径 * @param zipFilePath 压缩后文件存储路径 * @param zipFilename 压缩文件名 */ public static void compressToZip(String sourceFilePath, String zipFilePath, String zipFilename) { File sourceFile = new File(sourceFilePath); File zipPath = new File(zipFilePath); if (!zipPath.exists()) { zipPath.mkdirs(); } File zipFile = new File(zipPath + File.separator + zipFilename); try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipFile))) { writeZip(sourceFile, "", zos); //文件压缩完成后,删除被压缩文件 boolean flag = deleteDir(sourceFile); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage(), e.getCause()); } } /** * 遍历所有文件,压缩 * * @param file 源文件目录 * @param parentPath 压缩文件目录 * @param zos 文件流 */ private static void writeZip(File file, String parentPath, ZipOutputStream zos) { if (file.isDirectory()) { //目录 parentPath += file.getName() + File.separator; File[] files = file.listFiles(); for (File f : files) { writeZip(f, parentPath, zos); } } else { //文件 try (BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))) { //指定zip文件夹 ZipEntry zipEntry = new ZipEntry(parentPath + file.getName()); zos.putNextEntry(zipEntry); int len; byte[] buffer = new byte[1024 * 10]; while ((len = bis.read(buffer, 0, buffer.length)) != -1) { zos.write(buffer, 0, len); zos.flush(); } } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.getMessage(), e.getCause()); } } /** * 删除文件夹 * * @param dir * @return */ } private static boolean deleteDir (File dir){ if (dir.isDirectory()) { String[] children = dir.list(); for (int i = 0; i < children.length; i++) { boolean success = deleteDir(new File(dir, children[i])); if (!success) { return false; } } } //删除空文件夹 return dir.delete(); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/QRCodeUtils.java
New file @@ -0,0 +1,264 @@ package com.panzhihua.common.utlis; import java.awt.BasicStroke; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Image; import java.awt.Shape; import java.awt.geom.RoundRectangle2D; import java.awt.image.BufferedImage; import java.io.File; import java.io.OutputStream; import java.util.Hashtable; import java.util.Random; import javax.imageio.ImageIO; import com.google.zxing.BarcodeFormat; import com.google.zxing.BinaryBitmap; import com.google.zxing.DecodeHintType; import com.google.zxing.EncodeHintType; import com.google.zxing.MultiFormatReader; import com.google.zxing.MultiFormatWriter; import com.google.zxing.Result; import com.google.zxing.client.j2se.BufferedImageLuminanceSource; import com.google.zxing.common.BitMatrix; import com.google.zxing.common.HybridBinarizer; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; public class QRCodeUtils { private static final String CHARSET = "utf-8"; private static final String FORMAT_NAME = "JPG"; // 二维码尺寸 private static final int QRCODE_SIZE = 300; // LOGO宽度 private static final int WIDTH = 60; // LOGO高度 private static final int HEIGHT = 60; private static BufferedImage createImage(String content, String imgPath, boolean needCompress) throws Exception { Hashtable<EncodeHintType, Object> hints = new Hashtable<EncodeHintType, Object>(); hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.H); hints.put(EncodeHintType.CHARACTER_SET, CHARSET); hints.put(EncodeHintType.MARGIN, 1); BitMatrix bitMatrix = new MultiFormatWriter().encode(content, BarcodeFormat.QR_CODE, QRCODE_SIZE, QRCODE_SIZE, hints); int width = bitMatrix.getWidth(); int height = bitMatrix.getHeight(); BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); for (int x = 0; x < width; x++) { for (int y = 0; y < height; y++) { image.setRGB(x, y, bitMatrix.get(x, y) ? 0xFF000000 : 0xFFFFFFFF); } } if (imgPath == null || "".equals(imgPath)) { return image; } // 插入图片 QRCodeUtils.insertImage(image, imgPath, needCompress); return image; } /** * 插入LOGO * * @param source * 二维码图片 * @param imgPath * LOGO图片地址 * @param needCompress * 是否压缩 * @throws Exception */ private static void insertImage(BufferedImage source, String imgPath, boolean needCompress) throws Exception { File file = new File(imgPath); if (!file.exists()) { System.err.println(""+imgPath+" 该文件不存在!"); return; } Image src = ImageIO.read(new File(imgPath)); int width = src.getWidth(null); int height = src.getHeight(null); if (needCompress) { // 压缩LOGO if (width > WIDTH) { width = WIDTH; } if (height > HEIGHT) { height = HEIGHT; } Image image = src.getScaledInstance(width, height, Image.SCALE_SMOOTH); BufferedImage tag = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); Graphics g = tag.getGraphics(); g.drawImage(image, 0, 0, null); // 绘制缩小后的图 g.dispose(); src = image; } // 插入LOGO Graphics2D graph = source.createGraphics(); int x = (QRCODE_SIZE - width) / 2; int y = (QRCODE_SIZE - height) / 2; graph.drawImage(src, x, y, width, height, null); Shape shape = new RoundRectangle2D.Float(x, y, width, width, 6, 6); graph.setStroke(new BasicStroke(3f)); graph.draw(shape); graph.dispose(); } /** * 生成二维码(内嵌LOGO) * * @param content * 内容 * @param imgPath * LOGO地址 * @param destPath * 存放目录 * @param needCompress * 是否压缩LOGO * @throws Exception */ public static String encode(String content, String imgPath, String destPath, boolean needCompress) throws Exception { BufferedImage image = QRCodeUtils.createImage(content, imgPath, needCompress); mkdirs(destPath); String file = Snowflake.getId() + ".jpg"; ImageIO.write(image, FORMAT_NAME, new File(destPath+"/"+file)); return file; } /** * 当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) * @date 2013-12-11 上午10:16:36 * @param destPath 存放目录 */ public static void mkdirs(String destPath) { File file =new File(destPath); //当文件夹不存在时,mkdirs会自动创建多层目录,区别于mkdir.(mkdir如果父目录不存在则会抛出异常) if (!file.exists() && !file.isDirectory()) { file.mkdirs(); } } /** * 生成二维码(内嵌LOGO) * * @param content * 内容 * @param imgPath * LOGO地址 * @param destPath * 存储地址 * @throws Exception */ public static void encode(String content, String imgPath, String destPath) throws Exception { QRCodeUtils.encode(content, imgPath, destPath, false); } /** * 生成二维码 * * @param content * 内容 * @param destPath * 存储地址 * @param needCompress * 是否压缩LOGO * @throws Exception */ public static void encode(String content, String destPath, boolean needCompress) throws Exception { QRCodeUtils.encode(content, null, destPath, needCompress); } /** * 生成二维码 * * @param content * 内容 * @param destPath * 存储地址 * @throws Exception */ public static void encode(String content, String destPath) throws Exception { QRCodeUtils.encode(content, null, destPath, false); } /** * 生成二维码(内嵌LOGO) * * @param content * 内容 * @param imgPath * LOGO地址 * @param output * 输出流 * @param needCompress * 是否压缩LOGO * @throws Exception */ public static void encode(String content, String imgPath, OutputStream output, boolean needCompress) throws Exception { BufferedImage image = QRCodeUtils.createImage(content, imgPath, needCompress); ImageIO.write(image, FORMAT_NAME, output); } /** * 生成二维码 * * @param content * 内容 * @param output * 输出流 * @throws Exception */ public static void encode(String content, OutputStream output) throws Exception { QRCodeUtils.encode(content, null, output, false); } /** * 解析二维码 * * @param file * 二维码图片 * @return * @throws Exception */ public static String decode(File file) throws Exception { BufferedImage image; image = ImageIO.read(file); if (image == null) { return null; } BufferedImageLuminanceSource source = new BufferedImageLuminanceSource( image); BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source)); Result result; Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(); hints.put(DecodeHintType.CHARACTER_SET, CHARSET); result = new MultiFormatReader().decode(bitmap, hints); String resultStr = result.getText(); return resultStr; } /** * 解析二维码 * * @param path * 二维码图片地址 * @return * @throws Exception */ public static String decode(String path) throws Exception { return QRCodeUtils.decode(new File(path)); } } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/ComSwPatrolRecordApi.java
@@ -10,6 +10,9 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import com.jcraft.jsch.SftpException; import com.panzhihua.common.utlis.*; import org.apache.commons.io.FileUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -31,9 +34,6 @@ import com.panzhihua.common.model.vos.community.*; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.service.partybuilding.PartyBuildingService; import com.panzhihua.common.utlis.HttpUtils; import com.panzhihua.common.utlis.SFTPUtil; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; import freemarker.template.Configuration; @@ -243,7 +243,7 @@ */ @ApiOperation(value = "导出台账-隐患报告") @PostMapping("/danger/export") public R exportComMngCar(@RequestBody List<Long> dangerReportIds) { public R exportDangerReportBook(@RequestBody List<Long> dangerReportIds) { String url = excelUrl; String name = "隐患报告台账导出数据.xlsx"; String ftpUrl = "/mnt/data/web/excel/"; @@ -480,26 +480,31 @@ @PostMapping("/export/safetyWorkRecord") public R exportSafetyWorkRecord(@RequestBody List<Long> ids) { Long communityId = this.getLoginUserInfo().getCommunityId(); List<String> downLoadUrl = new ArrayList<>(); try { for (Long id : ids) { SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); String property = System.getProperty("user.dir"); String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; String zipFile=property+File.separator+"zip"+File.separator; String ftpUrl = "/mnt/data/web/excel/"; for (Long id : ids) { try { Map<String, Object> dataMap = new HashMap<String, Object>(); ComSwSafetyWorkRecordVO comSwSafetyWorkRecordVO = JSONObject.parseObject( JSONObject.toJSONString(communityService.detailSafetyWorkRecord(id, communityId).getData()), ComSwSafetyWorkRecordVO.class); // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 String ftpUrl = "/mnt/data/web/excel/"; String name = "安全工作记录_" + comSwSafetyWorkRecordVO.getId() + ".doc"; boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream = null; File file0=new File("d:/safetyWork/file"); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); } file0 = new File(sourceFile); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); } @@ -701,7 +706,7 @@ // 输出文档路径及名称 // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + // ".doc"); File file = new File(fileName); File file = new File(sourceFile + name); // 以utf-8的编码读取ftl文件 Template template = configuration.getTemplate("安全工作记录.ftl", "utf-8"); @@ -709,13 +714,13 @@ new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); template.process(dataMap, out); out.close(); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】", absolutePath, delete); // inputStream = new FileInputStream(file); // sftp.uploadMore(ftpUrl, name, inputStream); // sftp.logout(); // inputStream.close(); // String absolutePath = file.getAbsolutePath(); // boolean delete = file.delete(); // log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { @@ -723,41 +728,60 @@ } } } downLoadUrl.add(excelUrl + name); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); } return R.ok(downLoadUrl); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); } return R.fail(); FileUtil.compressToZip(sourceFile,zipFile,"安全工作记录.zip"); String currentDateString = String.valueOf(System.currentTimeMillis()); String name = "安全工作记录_"+ currentDateString+".zip"; try { InputStream inputStream=new FileInputStream(zipFile+"安全工作记录.zip"); sftp.uploadMore(ftpUrl, name , inputStream); sftp.logout(); inputStream.close(); FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); FileUtils.deleteDirectory(new File(zipFile)); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (SftpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return R.ok(excelUrl + name); } @ApiOperation(value = "下载巡查记录报告") @PostMapping("/export/patrolRecord") public R exportPatrolRecord(@RequestBody List<Long> ids) { Long communityId = this.getLoginUserInfo().getCommunityId(); List<String> downLoadUrl = new ArrayList<>(); try { for (Long id : ids) { SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); String property = System.getProperty("user.dir"); String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; String zipFile=property+File.separator+"zip"+File.separator; String ftpUrl = "/mnt/data/web/excel/"; for (Long id : ids) { try { Map<String, Object> dataMap = new HashMap<String, Object>(); ComSwPatrolRecordVO comSwPatrolRecordVO = JSONObject.parseObject(JSONObject.toJSONString(communityService.detailPatrolRecord(id).getData()), ComSwPatrolRecordVO.class); // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 String ftpUrl = "/mnt/data/web/excel/"; String name = "巡查记录_" + comSwPatrolRecordVO.getId() + ".doc"; boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream = null; File file0=new File("d:/patrolRecord/file"); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); } file0 = new File(sourceFile); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); } @@ -970,7 +994,7 @@ // 输出文档路径及名称 // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + // ".doc"); File file = new File(fileName); File file = new File(sourceFile + name); // 以utf-8的编码读取ftl文件 Template template = configuration.getTemplate("巡查记录.ftl", "utf-8"); @@ -978,13 +1002,13 @@ new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); template.process(dataMap, out); out.close(); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】", absolutePath, delete); // inputStream = new FileInputStream(file); // sftp.uploadMore(ftpUrl, name, inputStream); // sftp.logout(); // inputStream.close(); // String absolutePath = file.getAbsolutePath(); // boolean delete = file.delete(); // log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { @@ -992,509 +1016,543 @@ } } } downLoadUrl.add(excelUrl + name); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); } return R.ok(downLoadUrl); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); } return R.fail(); FileUtil.compressToZip(sourceFile,zipFile,"巡查记录.zip"); String currentDateString = String.valueOf(System.currentTimeMillis()); String name = "巡查记录_"+ currentDateString+".zip"; try { InputStream inputStream=new FileInputStream(zipFile+"巡查记录.zip"); sftp.uploadMore(ftpUrl, name , inputStream); sftp.logout(); inputStream.close(); FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); FileUtils.deleteDirectory(new File(zipFile)); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (SftpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return R.ok(excelUrl + name); } @ApiOperation(value = "下载隐患报告") @PostMapping("/export/DangerReport") public R exportDangerReport(@RequestBody List<Long> ids) { Long communityId = this.getLoginUserInfo().getCommunityId(); List<String> downLoadUrl = new ArrayList<>(); try { for (Long id : ids) { SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); Map<String, Object> dataMap = new HashMap<String, Object>(); ComSwDangerReportVO comSwDangerReportVO = JSONObject.parseObject(JSONObject.toJSONString(communityService.detailDangerReport(id).getData()), ComSwDangerReportVO.class); // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 String ftpUrl = "/mnt/data/web/excel/"; String name = "隐患报告_" + comSwDangerReportVO.getId() + ".doc"; SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); String property = System.getProperty("user.dir"); String sourceFile =property+File.separator+"word"+File.separator+System.currentTimeMillis()+File.separator; String zipFile=property+File.separator+"zip"+File.separator; String ftpUrl = "/mnt/data/web/excel/"; for (Long id : ids) { try { Map<String, Object> dataMap = new HashMap<String, Object>(); ComSwDangerReportVO comSwDangerReportVO = JSONObject.parseObject(JSONObject.toJSONString(communityService.detailDangerReport(id).getData()), ComSwDangerReportVO.class); // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 String name = "隐患报告_" + comSwDangerReportVO.getId() + ".doc"; boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream = null; File file0=new File("d:/dangerReport/file"); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream = null; File file0=new File("d:/dangerReport/file"); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); } file0 = new File(sourceFile); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); } sftp.download("/mnt/data/web/", "隐患报告.ftl", "d:/dangerReport/file/隐患报告.ftl"); sftp.download("/mnt/data/web/", "blank.jpg", "d:/dangerReport/file/blank.jpg"); try { // 日期 dataMap.put("date", comSwDangerReportVO.getCheckTime()); // 巡查类型 dataMap.put("patrolType", comSwDangerReportVO.getPatrolType()); // 地址 if (StringUtils.isNotEmpty(comSwDangerReportVO.getAddress())) { dataMap.put("address", comSwDangerReportVO.getAddress()); }else { dataMap.put("address", ""); } sftp.download("/mnt/data/web/", "隐患报告.ftl", "d:/dangerReport/file/隐患报告.ftl"); sftp.download("/mnt/data/web/", "blank.jpg", "d:/dangerReport/file/blank.jpg"); try { // 日期 dataMap.put("date", comSwDangerReportVO.getCheckTime()); // 巡查类型 dataMap.put("patrolType", comSwDangerReportVO.getPatrolType()); // 地址 if (StringUtils.isNotEmpty(comSwDangerReportVO.getAddress())) { dataMap.put("address", comSwDangerReportVO.getAddress()); }else { dataMap.put("address", ""); } // 隐患名称 if (StringUtils.isNotEmpty(comSwDangerReportVO.getDangerName())) { dataMap.put("dangerName", comSwDangerReportVO.getDangerName()); }else { dataMap.put("dangerName", ""); } // 排查时间 if (StringUtils.isNotEmpty(comSwDangerReportVO.getCheckTime())) { dataMap.put("checkTime", comSwDangerReportVO.getCheckTime()); }else { dataMap.put("checkTime", ""); } // 排查人员 if (StringUtils.isNotEmpty(comSwDangerReportVO.getPPersonName())) { dataMap.put("ppersonName", comSwDangerReportVO.getPPersonName()); }else { dataMap.put("ppersonName", ""); } // 填报人员 if (StringUtils.isNotEmpty(comSwDangerReportVO.getCreateName())) { dataMap.put("createName", comSwDangerReportVO.getCreateName()); }else { dataMap.put("createName", ""); } // 填报时间 dataMap.put("createAt", new SimpleDateFormat("yyyy-MM-dd").format(comSwDangerReportVO.getCreateAt())); // 隐患编号 dataMap.put("dangerNo", comSwDangerReportVO.getDangerNo()); // 主体部门、单位或个人全称 if (StringUtils.isNotEmpty(comSwDangerReportVO.getUnitName())) { dataMap.put("unitName", comSwDangerReportVO.getUnitName()); } else { dataMap.put("unitName", ""); } // 隐患简述 if (StringUtils.isNotEmpty(comSwDangerReportVO.getDagerDescription())) { dataMap.put("dagerDescription", comSwDangerReportVO.getDagerDescription()); } else { dataMap.put("dagerDescription", ""); } // 已采取的措施 if (StringUtils.isNotEmpty(comSwDangerReportVO.getTakeSteps())) { dataMap.put("takeSteps", comSwDangerReportVO.getTakeSteps()); } else { dataMap.put("takeSteps", ""); } // 措施照片 List<String> stepsPhoto = new ArrayList<>(); if (StringUtils.isNotEmpty(comSwDangerReportVO.getStepsPhoto())) { stepsPhoto = Arrays.asList(comSwDangerReportVO.getStepsPhoto().split(",")); } if (stepsPhoto.size() != 0 && null != stepsPhoto) { if (stepsPhoto.size() == 1) { for (int i = 0; i < 9; i++) { if (i < 1) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 1) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 2) { for (int i = 0; i < 9; i++) { if (i < 2) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 2) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 3) { for (int i = 0; i < 9; i++) { if (i < 3) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 3) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 4) { for (int i = 0; i < 9; i++) { if (i < 4) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 4) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 5) { for (int i = 0; i < 9; i++) { if (i < 5) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 5) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 6) { for (int i = 0; i < 9; i++) { if (i < 6) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 6) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 7) { for (int i = 0; i < 9; i++) { if (i < 7) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 7) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 8) { for (int i = 0; i < 9; i++) { if (i < 8) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 8) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 9) { for (int i = 0; i < 9; i++) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } for (int i = 0; i < 9; i++) { // 隐患名称 if (StringUtils.isNotEmpty(comSwDangerReportVO.getDangerName())) { dataMap.put("dangerName", comSwDangerReportVO.getDangerName()); }else { dataMap.put("dangerName", ""); } // 排查时间 if (StringUtils.isNotEmpty(comSwDangerReportVO.getCheckTime())) { dataMap.put("checkTime", comSwDangerReportVO.getCheckTime()); }else { dataMap.put("checkTime", ""); } // 排查人员 if (StringUtils.isNotEmpty(comSwDangerReportVO.getPPersonName())) { dataMap.put("ppersonName", comSwDangerReportVO.getPPersonName()); }else { dataMap.put("ppersonName", ""); } // 填报人员 if (StringUtils.isNotEmpty(comSwDangerReportVO.getCreateName())) { dataMap.put("createName", comSwDangerReportVO.getCreateName()); }else { dataMap.put("createName", ""); } // 填报时间 dataMap.put("createAt", new SimpleDateFormat("yyyy-MM-dd").format(comSwDangerReportVO.getCreateAt())); // 隐患编号 dataMap.put("dangerNo", comSwDangerReportVO.getDangerNo()); // 主体部门、单位或个人全称 if (StringUtils.isNotEmpty(comSwDangerReportVO.getUnitName())) { dataMap.put("unitName", comSwDangerReportVO.getUnitName()); } else { dataMap.put("unitName", ""); } // 隐患简述 if (StringUtils.isNotEmpty(comSwDangerReportVO.getDagerDescription())) { dataMap.put("dagerDescription", comSwDangerReportVO.getDagerDescription()); } else { dataMap.put("dagerDescription", ""); } // 已采取的措施 if (StringUtils.isNotEmpty(comSwDangerReportVO.getTakeSteps())) { dataMap.put("takeSteps", comSwDangerReportVO.getTakeSteps()); } else { dataMap.put("takeSteps", ""); } // 措施照片 List<String> stepsPhoto = new ArrayList<>(); if (StringUtils.isNotEmpty(comSwDangerReportVO.getStepsPhoto())) { stepsPhoto = Arrays.asList(comSwDangerReportVO.getStepsPhoto().split(",")); } if (stepsPhoto.size() != 0 && null != stepsPhoto) { if (stepsPhoto.size() == 1) { for (int i = 0; i < 9; i++) { if (i < 1) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } } else { for (int i = 0; i < 9; i++) { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } for (int i = 0; i < 9; i++) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } // 社区处理建议 if (StringUtils.isNotEmpty(comSwDangerReportVO.getCommunitySuggestion())) { dataMap.put("communitySuggestion", comSwDangerReportVO.getCommunitySuggestion()); } else { dataMap.put("communitySuggestion", ""); } // 街道安全管理人员建议 if (StringUtils.isNotEmpty(comSwDangerReportVO.getStreetSuggestion())) { dataMap.put("streetSuggestion", comSwDangerReportVO.getStreetSuggestion()); } else { dataMap.put("streetSuggestion", ""); } // 领导意见 if (StringUtils.isNotEmpty(comSwDangerReportVO.getLeaderSuggestion())) { dataMap.put("leaderSuggestion", comSwDangerReportVO.getLeaderSuggestion()); } else { dataMap.put("leaderSuggestion", ""); } // 承办记录 if (StringUtils.isNotEmpty(comSwDangerReportVO.getUndertakeRecord())) { dataMap.put("undertakeRecord", comSwDangerReportVO.getUndertakeRecord()); } else { dataMap.put("undertakeRecord", ""); } // 巡查记录 if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordContent())) { dataMap.put("recordContent", comSwDangerReportVO.getRecordContent()); } else { dataMap.put("recordContent", ""); } // 发现记录 if (StringUtils.isNotEmpty(comSwDangerReportVO.getFindRecord())) { dataMap.put("findRecord", comSwDangerReportVO.getFindRecord()); } else { dataMap.put("findRecord", ""); } // 记录照片 List<String> photo = new ArrayList<>(); if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordPhoto())) { photo = Arrays.asList(comSwDangerReportVO.getRecordPhoto().split(",")); } if (photo.size() != 0 && null != photo) { if (photo.size() == 1) { for (int i = 0; i < 9; i++) { if (i < 1) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } if (i < 1) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 2) { for (int i = 0; i < 9; i++) { if (i < 2) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (stepsPhoto.size() == 2) { for (int i = 0; i < 9; i++) { if (i < 2) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 3) { for (int i = 0; i < 9; i++) { if (i < 3) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } for (int i = 0; i < 9; i++) { if (i < 2) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 4) { for (int i = 0; i < 9; i++) { if (i < 4) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (stepsPhoto.size() == 3) { for (int i = 0; i < 9; i++) { if (i < 3) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 5) { for (int i = 0; i < 9; i++) { if (i < 5) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } for (int i = 0; i < 9; i++) { if (i < 3) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 6) { for (int i = 0; i < 9; i++) { if (i < 6) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (stepsPhoto.size() == 4) { for (int i = 0; i < 9; i++) { if (i < 4) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 7) { for (int i = 0; i < 9; i++) { if (i < 7) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } for (int i = 0; i < 9; i++) { if (i < 4) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 8) { for (int i = 0; i < 9; i++) { if (i < 8) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (stepsPhoto.size() == 5) { for (int i = 0; i < 9; i++) { if (i < 5) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } if (photo.size() == 9) { for (int i = 0; i < 9; i++) { for (int i = 0; i < 9; i++) { if (i < 5) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 6) { for (int i = 0; i < 9; i++) { if (i < 6) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 6) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 7) { for (int i = 0; i < 9; i++) { if (i < 7) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 7) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 8) { for (int i = 0; i < 9; i++) { if (i < 8) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } } for (int i = 0; i < 9; i++) { if (i < 8) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (stepsPhoto.size() == 9) { for (int i = 0; i < 9; i++) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } for (int i = 0; i < 9; i++) { downloadPicture(stepsPhoto.get(i), comSwDangerReportVO.getId() + "_steps_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_steps_" + i + ".jpg")); } } } else { for (int i = 0; i < 9; i++) { dataMap.put("imgStr" + (i + 1), getImageStr("d:/dangerReport/file/blank.jpg")); } for (int i = 0; i < 9; i++) { dataMap.put("imgStr" + (i + 19), getImageStr("d:/dangerReport/file/blank.jpg")); } } // 社区处理建议 if (StringUtils.isNotEmpty(comSwDangerReportVO.getCommunitySuggestion())) { dataMap.put("communitySuggestion", comSwDangerReportVO.getCommunitySuggestion()); } else { dataMap.put("communitySuggestion", ""); } // 街道安全管理人员建议 if (StringUtils.isNotEmpty(comSwDangerReportVO.getStreetSuggestion())) { dataMap.put("streetSuggestion", comSwDangerReportVO.getStreetSuggestion()); } else { dataMap.put("streetSuggestion", ""); } // 领导意见 if (StringUtils.isNotEmpty(comSwDangerReportVO.getLeaderSuggestion())) { dataMap.put("leaderSuggestion", comSwDangerReportVO.getLeaderSuggestion()); } else { dataMap.put("leaderSuggestion", ""); } // 承办记录 if (StringUtils.isNotEmpty(comSwDangerReportVO.getUndertakeRecord())) { dataMap.put("undertakeRecord", comSwDangerReportVO.getUndertakeRecord()); } else { dataMap.put("undertakeRecord", ""); } // 巡查记录 if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordContent())) { dataMap.put("recordContent", comSwDangerReportVO.getRecordContent()); } else { dataMap.put("recordContent", ""); } // 发现记录 if (StringUtils.isNotEmpty(comSwDangerReportVO.getFindRecord())) { dataMap.put("findRecord", comSwDangerReportVO.getFindRecord()); } else { dataMap.put("findRecord", ""); } // 记录照片 List<String> photo = new ArrayList<>(); if (StringUtils.isNotEmpty(comSwDangerReportVO.getRecordPhoto())) { photo = Arrays.asList(comSwDangerReportVO.getRecordPhoto().split(",")); } if (photo.size() != 0 && null != photo) { if (photo.size() == 1) { for (int i = 0; i < 9; i++) { if (i < 1) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } else { } if (photo.size() == 2) { for (int i = 0; i < 9; i++) { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); if (i < 2) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } // 备注 if (StringUtils.isNotEmpty(comSwDangerReportVO.getRemark())) { dataMap.put("remark", comSwDangerReportVO.getRemark()); } else { dataMap.put("remark", ""); if (photo.size() == 3) { for (int i = 0; i < 9; i++) { if (i < 3) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } // 整改时间 if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyTime())) { dataMap.put("rectifyTime", comSwDangerReportVO.getRectifyTime()); } else { dataMap.put("rectifyTime", ""); if (photo.size() == 4) { for (int i = 0; i < 9; i++) { if (i < 4) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } // 整改人员 if (StringUtils.isNotEmpty(comSwDangerReportVO.getDPersonName())) { dataMap.put("dpersonName", comSwDangerReportVO.getDPersonName()); } else { dataMap.put("dpersonName", ""); if (photo.size() == 5) { for (int i = 0; i < 9; i++) { if (i < 5) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } // 获取请求url String url = Constants.G_D_WEATHER_URL; // 获取请求参数 String param = "key=" + Constants.G_D_WEATHER_KEY + "&city=510400"; String result = HttpUtils.sendGet(url, param); R r = R.ok(JSON.parseObject(result)); WeatherVO weatherVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), WeatherVO.class); if (null != weatherVO) { LiveVO liveVO = weatherVO.getLives().get(0); // 城市 dataMap.put("city", liveVO.getCity()); // 天气 dataMap.put("weather", liveVO.getWeather()); // 温度 dataMap.put("temperature", liveVO.getTemperature()); // 风向 dataMap.put("winddirection", liveVO.getWinddirection()); // 风力 dataMap.put("windpower", liveVO.getWindpower()); if (photo.size() == 6) { for (int i = 0; i < 9; i++) { if (i < 6) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } Configuration configuration = new Configuration(new Version("2.3.0")); configuration.setDefaultEncoding("utf-8"); /** * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径 */ // 指定路径的第一种方式(根据某个类的相对路径指定) // configuration.setClassForTemplateLoading(this.getClass(), ""); // 指定路径的第二种方式,我的路径是C:/a.ftl configuration.setDirectoryForTemplateLoading(new File("/mnt/data/web/")); // 输出文档路径及名称 // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + // ".doc"); File file = new File(fileName); // 以utf-8的编码读取ftl文件 Template template = configuration.getTemplate("隐患报告.ftl", "utf-8"); Writer out = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); template.process(dataMap, out); out.close(); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { inputStream.close(); if (photo.size() == 7) { for (int i = 0; i < 9; i++) { if (i < 7) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (photo.size() == 8) { for (int i = 0; i < 9; i++) { if (i < 8) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } else { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } } if (photo.size() == 9) { for (int i = 0; i < 9; i++) { downloadPicture(photo.get(i), comSwDangerReportVO.getId() + "_find_" + i, "d:/dangerReport/file/"); dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/" + comSwDangerReportVO.getId() + "_find_" + i + ".jpg")); } } } else { for (int i = 0; i < 9; i++) { dataMap.put("imgStr" + (i + 10), getImageStr("d:/dangerReport/file/blank.jpg")); } } // 备注 if (StringUtils.isNotEmpty(comSwDangerReportVO.getRemark())) { dataMap.put("remark", comSwDangerReportVO.getRemark()); } else { dataMap.put("remark", ""); } // 整改时间 if (StringUtils.isNotEmpty(comSwDangerReportVO.getRectifyTime())) { dataMap.put("rectifyTime", comSwDangerReportVO.getRectifyTime()); } else { dataMap.put("rectifyTime", ""); } // 整改人员 if (StringUtils.isNotEmpty(comSwDangerReportVO.getDPersonName())) { dataMap.put("dpersonName", comSwDangerReportVO.getDPersonName()); } else { dataMap.put("dpersonName", ""); } // 获取请求url String url = Constants.G_D_WEATHER_URL; // 获取请求参数 String param = "key=" + Constants.G_D_WEATHER_KEY + "&city=510400"; String result = HttpUtils.sendGet(url, param); R r = R.ok(JSON.parseObject(result)); WeatherVO weatherVO = JSONObject.parseObject(JSONObject.toJSONString(r.getData()), WeatherVO.class); if (null != weatherVO) { LiveVO liveVO = weatherVO.getLives().get(0); // 城市 dataMap.put("city", liveVO.getCity()); // 天气 dataMap.put("weather", liveVO.getWeather()); // 温度 dataMap.put("temperature", liveVO.getTemperature()); // 风向 dataMap.put("winddirection", liveVO.getWinddirection()); // 风力 dataMap.put("windpower", liveVO.getWindpower()); } Configuration configuration = new Configuration(new Version("2.3.0")); configuration.setDefaultEncoding("utf-8"); /** * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径 */ // 指定路径的第一种方式(根据某个类的相对路径指定) // configuration.setClassForTemplateLoading(this.getClass(), ""); // 指定路径的第二种方式,我的路径是C:/a.ftl configuration.setDirectoryForTemplateLoading(new File("d:/dangerReport/file/")); // 输出文档路径及名称 // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + // ".doc"); File file = new File(sourceFile+name); // 以utf-8的编码读取ftl文件 Template template = configuration.getTemplate("隐患报告.ftl", "utf-8"); Writer out = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); template.process(dataMap, out); out.close(); // inputStream = new FileInputStream(file); // sftp.uploadMore(ftpUrl, name, inputStream); // sftp.logout(); // inputStream.close(); // String absolutePath = file.getAbsolutePath(); // boolean delete = file.delete(); // log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { inputStream.close(); } } downLoadUrl.add(excelUrl + name); } return R.ok(downLoadUrl); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); } } return R.fail(); FileUtil.compressToZip(sourceFile,zipFile,"隐患报告.zip"); String currentDateString = String.valueOf(System.currentTimeMillis()); String name = "隐患报告_"+ currentDateString+".zip"; try { InputStream inputStream=new FileInputStream(zipFile+"隐患报告.zip"); sftp.uploadMore(ftpUrl, name , inputStream); sftp.logout(); inputStream.close(); FileUtils.deleteDirectory(new File(property+File.separator+"word"+File.separator)); FileUtils.deleteDirectory(new File(zipFile)); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (SftpException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return R.ok(excelUrl + name); } private List<List<String>> headDataFilling() { springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityActivityApi.java
@@ -1,17 +1,23 @@ package com.panzhihua.community_backstage.api; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.io.*; import java.math.BigDecimal; import java.util.Date; import java.util.List; import java.nio.charset.StandardCharsets; import java.text.SimpleDateFormat; import java.util.*; import javax.annotation.Resource; import javax.validation.Valid; import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; import com.alibaba.fastjson.JSON; import com.panzhihua.common.constants.Constants; import com.panzhihua.common.model.vos.LiveVO; import com.panzhihua.common.model.vos.WeatherVO; import com.panzhihua.community_backstage.excel.CustomSheetWriteHandler; import freemarker.template.Configuration; import freemarker.template.Template; import freemarker.template.Version; import org.springframework.beans.factory.annotation.Value; import org.springframework.util.ObjectUtils; import org.springframework.validation.annotation.Validated; @@ -42,6 +48,7 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import sun.misc.BASE64Encoder; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -214,21 +221,75 @@ return communityService.listActivitySign(activitySignVO); } @ApiOperation(value = "分页查询活动评价") @ApiOperation(value = "excel导出-活动报名名单") @PostMapping("sign/export") public R activityExportSign(@RequestBody ActivitySignVO activitySignVO) { String name = "活动报名名单导出数据.xlsx"; String ftpUrl = "/mnt/data/web/excel/"; R r = communityService.getSignLists(activitySignVO); if (R.isOk(r)) { List<ComActActSignExcelVO> excelVOS = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActSignExcelVO.class); try { SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream = null; try { excelWriter = EasyExcel.write(fileName, ComActActSignExcelVO.class) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(new CustomSheetWriteHandler()).build(); WriteSheet writeSheet = EasyExcel.writerSheet("活动报名名单导出数据").build(); excelWriter.write(excelVOS, writeSheet); excelWriter.finish(); File file = new File(fileName); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { inputStream.close(); } if (excelWriter != null) { excelWriter.finish(); } } } return R.ok(excelUrl + name); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); return R.fail(); } } return R.fail("未查询到用户"); } @ApiOperation(value = "分页查询活动评价记录", response = ComActActEvaluateVO.class) @PostMapping("evaluate/page") public R pageActivityRegists(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { if (ObjectUtils.isEmpty(comActActEvaluateVO.getActivityId())) { return R.fail("活动id主键不能为空"); } return communityService.pageActivityRegists(comActActEvaluateVO); return communityService.pageActivityEvaluates(comActActEvaluateVO); } @ApiOperation(value = "excel导出-活动评价") @PostMapping("evaluate/export") public R activityExportEvaluate(@RequestBody List<Long> Ids) { public R activityExportEvaluate(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { String name = "活动评价导出数据.xlsx"; String ftpUrl = "/mnt/data/web/excel/"; R r = communityService.getEvaluateListsByIds(Ids); R r = communityService.getEvaluateLists(comActActEvaluateVO); if (R.isOk(r)) { List<ComActActEvaluateExcelVO> excelVOS = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActEvaluateExcelVO.class); @@ -275,6 +336,147 @@ } } return R.fail("未查询到用户"); } @ApiOperation(value = "分页查询活动签到记录", response = ComActActRegistVO.class) @PostMapping("regist/page") public R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO) { if (ObjectUtils.isEmpty(comActActRegistVO.getActivityId())) { return R.fail("活动id主键不能为空"); } return communityService.pageActivityRegists(comActActRegistVO); } @ApiOperation(value = "excel导出-活动签到") @PostMapping("regist/export") public R activityExportRegist(@RequestBody ComActActRegistVO comActActRegistVO) { String name = "活动签到导出数据.xlsx"; String ftpUrl = "/mnt/data/web/excel/"; R r = communityService.getRegistLists(comActActRegistVO); if (R.isOk(r)) { List<ComActActRegistExcelVO> excelVOS = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComActActRegistExcelVO.class); try { SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream = null; try { excelWriter = EasyExcel.write(fileName, ComActActRegistExcelVO.class) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(new CustomSheetWriteHandler()).build(); WriteSheet writeSheet = EasyExcel.writerSheet("活动签到导出数据").build(); excelWriter.write(excelVOS, writeSheet); excelWriter.finish(); File file = new File(fileName); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { inputStream.close(); } if (excelWriter != null) { excelWriter.finish(); } } } return R.ok(excelUrl + name); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); return R.fail(); } } return R.fail("未查询到用户"); } @ApiOperation(value = "社区活动数据统计", response = ComActActivityStatisticsVO.class) @GetMapping("statistics") public R activityStatistics(@RequestParam("activityId") Long activityId){ return communityService.activityStatistics(activityId); } @ApiOperation(value = "社区活动签到二维码下载") @GetMapping("qrCode/export") public R activityRegistQRCodeExport(@RequestParam("activityId") Long activityId){ try { SFTPUtil sftp = new SFTPUtil(userName, password, host, port); sftp.login(); Map<String, Object> dataMap = new HashMap<String, Object>(); // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 String ftpUrl = "/mnt/data/web/excel/"; String name = "社区活动签到二维码_" + activityId + ".doc"; boolean existDir = sftp.isExistDir(ftpUrl + name); if (!existDir) { String property = System.getProperty("user.dir"); String fileName = property + File.separator + name; // 这里 需要指定写用哪个class去写 ExcelWriter excelWriter = null; InputStream inputStream = null; File file0=new File("d:/comActivity/file"); if(!file0.isDirectory()&&!file0.exists()){ file0.mkdirs(); } sftp.download("/mnt/data/web/", "社区活动二维码.ftl", "d:/comActivity/file/社区活动二维码.ftl"); try { String text = String.valueOf(activityId); String destPath = "d:/comActivity/file/"; String downFile = QRCodeUtils.encode(text, null, destPath, false); dataMap.put("imgStr", getImageStr("d:/comActivity/file/" + downFile)); Configuration configuration = new Configuration(new Version("2.3.0")); configuration.setDefaultEncoding("utf-8"); /** * 以下是两种指定ftl文件所在目录路径的方式,注意这两种方式都是 指定ftl文件所在目录的路径,而不是ftl文件的路径 */ // 指定路径的第一种方式(根据某个类的相对路径指定) // configuration.setClassForTemplateLoading(this.getClass(), ""); // 指定路径的第二种方式,我的路径是C:/a.ftl configuration.setDirectoryForTemplateLoading(new File("d:/comActivity/file/")); // 输出文档路径及名称 // File outFile = new File("mnt/data/web/excel/安全工作记录_" + comSwSafetyWorkRecordVO.getId() + // ".doc"); File file = new File(fileName); // 以utf-8的编码读取ftl文件 Template template = configuration.getTemplate("社区活动二维码.ftl", "utf-8"); Writer out = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8), 10240); template.process(dataMap, out); out.close(); inputStream = new FileInputStream(file); sftp.uploadMore(ftpUrl, name, inputStream); sftp.logout(); inputStream.close(); String absolutePath = file.getAbsolutePath(); boolean delete = file.delete(); log.info("删除excel【{}】结果【{}】", absolutePath, delete); } finally { // 千万别忘记finish 会帮忙关闭流 if (inputStream != null) { inputStream.close(); } } } return R.ok(excelUrl + name); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); return R.fail(); } } @ApiOperation(value = "新增社区动态") @@ -741,4 +943,20 @@ } return communityService.easyPhotoNoHandleList(loginUserInfo.getCommunityId()); } public String getImageStr(String fileName) { String imgFile = fileName; InputStream in = null; byte[] data = null; try { in = new FileInputStream(imgFile); data = new byte[in.available()]; in.read(data); in.close(); } catch (Exception e) { e.printStackTrace(); } BASE64Encoder encoder = new BASE64Encoder(); return encoder.encode(data); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommunityApi.java
@@ -511,6 +511,18 @@ } /** * description getSignLists 查询活动报名名单 * @param activitySignVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ @PostMapping("activity/sign/getList") public R getSignLists(@RequestBody ActivitySignVO activitySignVO){ return comActActivityService.getSignLists(activitySignVO); } /** * description listActivityRegists 分页查询活动评价 * @param comActActEvaluateVO 活动评价vo * @return R 分页查询结果 @@ -518,20 +530,56 @@ * @date 2021/8/24 14:03 */ @PostMapping("activity/evaluate/page") public R pageActivityRegists(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { return comActActivityService.pageActivityRegists(comActActEvaluateVO); public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { return comActActivityService.pageActivityEvaluates(comActActEvaluateVO); } /** * description getEvaluateListsByIds 批量查询活动评价 * @param ids ids * description getEvaluateLists 查询活动评价 * @param comActActEvaluateVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ @PostMapping("/activity/evaluate/getList") public R getEvaluateListsByIds(@RequestBody List<Long> ids){ return comActActivityService.getEvaluateListsByIds(ids); @PostMapping("activity/evaluate/getList") public R getEvaluateLists(@RequestBody ComActActEvaluateVO comActActEvaluateVO){ return comActActivityService.getEvaluateLists(comActActEvaluateVO); } /** * description pageActivityRegists 分页查询活动签到 * @param comActActRegistVO 活动签到vo * @return R 分页查询结果 * @author txb * @date 2021/8/24 14:03 */ @PostMapping("activity/regist/page") public R pageActivityRegists(@RequestBody ComActActRegistVO comActActRegistVO) { return comActActivityService.pageActivityRegists(comActActRegistVO); } /** * description getRegistLists 查询活动签到 * @param comActActRegistVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/25 9:33 */ @PostMapping("activity/regist/getList") public R getRegistLists(@RequestBody ComActActRegistVO comActActRegistVO){ return comActActivityService.getRegistLists(comActActRegistVO); } /** * description activityStagistics 活动数据统计 * @param activityId 活动id * @return R 统计结果 * @author txb * @date 2021/8/25 13:33 */ @GetMapping("activity/statistics") public R activityStatistics(@RequestParam("activityId") Long activityId){ return comActActivityService.activityStatistics(activityId); } /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActEvaluateDAO.java
@@ -6,6 +6,7 @@ import com.panzhihua.common.model.vos.community.ActivitySignVO; import com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO; import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; import com.panzhihua.common.model.vos.community.ComActActRegistVO; import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -23,8 +24,8 @@ @Mapper public interface ComActActEvaluateDAO extends BaseMapper<ComActActEvaluateDO> { IPage<ComActActEvaluateVO> pageActivityRegists(Page page, @Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); IPage<ComActActEvaluateVO> pageActivityEvaluates(Page page, @Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); List<ComActActEvaluateExcelVO> getEvaluateListsByIds(@Param("ids") List<Long> ids); List<ComActActEvaluateExcelVO> getEvaluateLists(@Param("comActActEvaluateVO") ComActActEvaluateVO comActActEvaluateVO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActRegistDAO.java
@@ -1,8 +1,16 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO; import com.panzhihua.common.model.vos.community.ComActActRegistExcelVO; import com.panzhihua.common.model.vos.community.ComActActRegistVO; import com.panzhihua.service_community.model.dos.ComActActRegistDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; /** * title: ComActActRegistDAO 社区》活动》活动签到表mapper类 @@ -15,4 +23,8 @@ @Mapper public interface ComActActRegistDAO extends BaseMapper<ComActActRegistDO> { IPage<ComActActRegistVO> pageActivityRegists(Page page, @Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); List<ComActActRegistExcelVO> getRegistLists(@Param("comActActRegistVO") ComActActRegistVO comActActRegistVO); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActSignDAO.java
@@ -3,6 +3,7 @@ import java.util.List; import java.util.Map; import com.panzhihua.common.model.vos.community.ComActActSignExcelVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -26,10 +27,12 @@ // 居民 党员 志愿者 1 2 3 @Select("<script> " + "SELECT " + "u.user_id id, " + "u.image_url, " + "u.name, " + "u.nick_name, " + "case WHEN u.is_partymember = 1 THEN '党员' WHEN a.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity, " + "u.phone, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " + "u.phone, " + "u.tags, " + "a.create_at, " + "a.is_volunteer " + "FROM " + "com_act_act_sign a " + "JOIN sys_user u ON a.user_id = u.user_id " + "WHERE " + "a.activity_id = #{activitySignVO.activityId} " + "<if test='activitySignVO.phone != null and activitySignVO.phone != ""'>" + "AND u.phone = #{activitySignVO.phone} " + " </if> " + "<if test='activitySignVO.tags != null and activitySignVO.tags != ""'>" + "AND u.tags like concat('%',#{activitySignVO.tags},'%') " + " </if> " + "<if test='activitySignVO.name != null and activitySignVO.name != ""'>" + "AND u.`name` = #{activitySignVO.name} " + " </if> " + "<if test='activitySignVO.identity != null and activitySignVO.identity != "" and activitySignVO.identity==1'>" @@ -58,6 +61,8 @@ + "AND a.is_volunteer=#{activitySignVO.type}-1 " + " </if> " + " order by a.create_at desc " + "</script>") List<ActivitySignVO> listActivitySigns(@Param("activitySignVO") ActivitySignVO activitySignVO); List<ComActActSignExcelVO> getSignLists (@Param("activitySignVO") ActivitySignVO activitySignVO); @Select("<script> " + "SELECT " + " caas.user_id, " + " su.NAME, " + "CASE " + " WHEN su.is_volunteer = 1 THEN " + " '志愿者' ELSE '居民' " + " END identity, " + " su.phone, " + " caas.create_at " + "FROM " + " com_act_act_sign AS caas " springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComActActivityDAO.java
@@ -4,6 +4,7 @@ import java.util.List; import java.util.Map; import com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Select; @@ -194,6 +195,8 @@ + " su.is_volunteer = 1 " + " AND activity_id = #{activityId} ") ActActivityListVO getScreenActActivityPeopleCount(@Param("activityId") Long activityId); ComActActivityStatisticsVO activityStatistics (@Param("activityId") Long activityId); /** * 查询置于顶部的进行中活动 * @param communityId 社区id springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationCommunityTagsDAO.java
@@ -16,7 +16,6 @@ @Mapper public interface ComMngPopulationCommunityTagsDAO extends BaseMapper<ComMngPopulationCommunityTagsDO> { void updateAll( @Param("populationCommunityTagsList") List<ComMngPopulationCommunityTagsDO> populationCommunityTagsList); void updateAll(@Param("comMngPopulationCommunityTagsDOS") List<ComMngPopulationCommunityTagsDO> comMngPopulationCommunityTagsDOS); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -196,18 +196,19 @@ + " from com_mng_population_community_tags as cmpct where community_id = #{communityId}") ComMngPopulationTotalVO getPopulationTotalByAdmin(@Param("communityId") Long communityId); @Select("select count(id) as populationTotal," + "IFNULL((select count(id) from com_mng_population_house where community_id = cmp.act_id),0) as houseTotal, " + "IFNULL((select count(id) from com_mng_real_company where community_id = cmp.act_id),0) as companyTotal, " + "IFNULL((select count(village_id) from com_mng_village where community_id = cmp.act_id),0) as villageTotal " + " com_mng_population_community_tags as cmpct " + " where community_id = = #{communityId}") @Select("select count(id) as populationTotal," + "IFNULL((select count(id) from com_mng_population_house where community_id = cmpct.community_id),0) as houseTotal, " + "IFNULL((select count(id) from com_mng_real_company where community_id = cmpct.community_id),0) as companyTotal, " + "IFNULL((select count(village_id) from com_mng_village where community_id = cmpct.community_id),0) as villageTotal " + " from com_mng_population_community_tags AS cmpct " + " where cmpct.community_id = #{communityId}") IndexBasicsStatisticsVO getScreenIndexByBasics(@Param("communityId") Long communityId); @Select("SELECT " + " IFNULL( NULL, 1 ) AS type, " + " count( cmpct.id ) AS sum " + "FROM " + " com_mng_population_community_tags as cmpct " + " left join com_mng_population as cmp on cmpct.population_id = cmp.id " + "WHERE " + " cmp.sex = 1 " + " AND cmpct.community_id = #{communityId} UNION ALL " + "SELECT " + " IFNULL( NULL, 2 ) AS type, " + " count( id ) AS sum " + "FROM " + " com_mng_population_community_tags as cmpct " + " count( cmpct.id ) AS sum " + "FROM " + " com_mng_population_community_tags as cmpct " + " left join com_mng_population as cmp on cmpct.population_id = cmp.id " + "WHERE " + " cmp.sex = 2 " + " AND cmpct.community_id = #{communityId}") List<IndexPopulationSexStatisticsVO> getScreenIndexByPopulationSex(@Param("communityId") Long communityId); @@ -270,8 +271,8 @@ List<ComMngUserTagVO> getUserTagListByCommunityId(@Param("communityId") Long communityId); @Select("SELECT " + " count( id ) " + "FROM " + " com_mng_population_community_tags " + "WHERE " + " label like concat('%',#{label},'%')") Integer getSpecialStatisticsByLabel(@Param("label") String label); + " community_id = #{communityId} and label like concat('%',#{label},'%')") Integer getSpecialStatisticsByLabel(@Param("label") String label,@Param("communityId") Long communityId); @Select("<script> " + "SELECT " + " count( egd.id ) AS gridTotal, " + " ( SELECT count( user_id ) FROM sys_user WHERE community_id = egd.grid_community_id AND type = 6 ) AS gridMemberTotal, " @@ -403,7 +404,7 @@ + " AND create_at <![CDATA[>=]]> #{screenEventDTO.startTime} " + " </if> " + "<if test='screenEventDTO.endTime != null and screenEventDTO.endTime != ""'>" + " AND create_at <![CDATA[<=]]> #{screenEventDTO.endTime} " + " </if> " + "), 0 ) AS eventSSPTotal, " + " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND handle_status = 2 AND community_id = #{screenEventDTO.communityId} " + " IFNULL(( SELECT count( id ) FROM com_act_easy_photo WHERE del_tag = 0 AND status = 4 AND community_id = #{screenEventDTO.communityId} " + "<if test='screenEventDTO.startTime != null and screenEventDTO.startTime != ""'>" + " AND create_at <![CDATA[>=]]> #{screenEventDTO.startTime} " + " </if> " + "<if test='screenEventDTO.endTime != null and screenEventDTO.endTime != ""'>" @@ -506,15 +507,15 @@ @Select("SELECT " + "(SELECT COUNT(aa.age) FROM " + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) as aa where aa.age<= 16) as age16," + "(SELECT COUNT(aa.age) FROM " + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27," + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 16 and aa.age<= 27) AS age27," + "(SELECT COUNT(aa.age) FROM " + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35," + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 27 and aa.age<= 35) AS age35," + "(SELECT COUNT(aa.age) FROM " + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 35 and aa.age<= 45) AS age45," + "(SELECT COUNT(aa.age) FROM " + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 45 and aa.age<= 55) AS age55," + "(SELECT COUNT(aa.age) FROM " + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population as cmp left join com_mng_population_community_tags as cmpct on cmp.id = cmpct.population_id WHERE cmpct.community_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") + "(SELECT (SELECT TIMESTAMPDIFF(YEAR, cmp.birthday, CURDATE()) ) AS age FROM com_mng_population_community_tags as capct left join com_mng_population as cmp on cmp.id = capct.population_id and capct.community_id = #{communityId}) AS aa WHERE aa.age > 55) AS age55over") Map<String, Long> indexCountByAge(@Param("communityId") Long communityId); @Select("SELECT " + " id, " + " su.nick_name AS userName, " + " su.image_url, " + " caep.create_at, " @@ -569,7 +570,7 @@ + " id = #{populationId}") PopulationDetailVO getPopulationDetailApp(@Param("populationId") Long populationId); @Select("<script> " + "SELECT " + " * " + "FROM " + " ( " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " @Select("<script> " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " + " cmpct.label, " + " cmp.card_no, " + " cmp.card_no_str, " + " cmp.sex, " + " cmp.address, " + " cmp.political_outlook, " + " cmp.census_register, " + " cmp.house_id, " + " cmp.phone, " + " IFNULL(cmp.house_id,0) as isHouse, " @@ -588,9 +589,7 @@ + "AND cmp.house_id is null " + " </if> " + "<if test='populationListDTO.communityId != null'>" + "AND cmpct.community_id = #{populationListDTO.communityId} " + " </if> " + "<if test='populationListDTO.politicalOutlook != null'>" + "AND cmp.political_outlook = #{populationListDTO.politicalOutlook} " + " </if> " + " ) as population where 1=1 " + "<if test='populationListDTO.eventStatus != null'>" + "AND population.eventStatus = #{populationListDTO.eventStatus} " + " </if> " + " </script>") + "AND cmp.political_outlook = #{populationListDTO.politicalOutlook} " + " </if> " + " </script>") IPage<ComMngPopulationListVO> getGridPopulationAdminList(Page page, @Param("populationListDTO") ComMngPopulationListDTO populationListDTO); @@ -616,18 +615,15 @@ @Param("populationDTO") PageComMngPopulationDTO populationDTO); @Select("<script> " + "SELECT " + " count( id ) AS localNum, " + " ( SELECT count( cmpct.id ) FROM com_mng_population_community_tags as cmpct left join com_mng_population as cmp on cmp.id = cmpct.population_id WHERE cmp.out_or_local = 2 " + "<if test='communityId != null and communityId != 0'>" + " AND cmpct.community_id = #{communityId} " + " </if> " + " ) AS flowNum, " + " ( SELECT count( cmpct.id ) FROM com_mng_population_community_tags as cmpct left join com_mng_population as cmp on cmp.id = cmpct.population_id WHERE cmpct.label IS NOT NULL " + "<if test='communityId != null and communityId != 0'>" + " AND cmpct.community_id = #{communityId} " + " </if> " + " ) AS specialNum " + "FROM " + " com_mng_population_community_tags as cmpct left join com_mng_population as cmp on cmp.id = cmpct.population_id " + "WHERE " + " cmp.out_or_local = 1 " + "<if test='communityId != null and communityId != 0'>" + " AND cmpct.community_id = #{communityId} " + " </if> " + " </script>") + " ( SELECT count( cmp.id ) FROM com_mng_population as cmp WHERE cmp.out_or_local = 2 " + " ) AS flowNum, " + " ( SELECT count( cmpct.id ) FROM com_mng_population as cmp left join com_mng_population_community_tags AS cmpct on cmp.id = cmpct.population_id WHERE cmpct.label IS NOT NULL " + " ) AS specialNum " + "FROM " + " com_mng_population as cmp " + "WHERE " + " cmp.out_or_local = 1 " + " </script>") PopulationStatisticsVO getGridPopulationStatistics(@Param("communityId") Long communityId); @Select("<script> " + "SELECT " + " * " + "FROM " + " ( " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " @Select("<script> " + " SELECT " + " cmp.id, " + " cmp.`name` AS userName, " + " cmpct.label, " + " cmp.card_no, " + " cmp.card_no_str, " + " cmp.sex, " + " cmp.address, " + " cmp.political_outlook, " + " cmp.census_register, " + " cmp.house_id, " + " cmp.phone, " + " IFNULL(cmp.house_id,0) as isHouse, " @@ -650,9 +646,7 @@ + "AND cmp.house_id is null " + " </if> " + "<if test='populationExportDTO.communityId != null'>" + "AND cmpct.community_id = #{populationExportDTO.communityId} " + " </if> " + "<if test='populationExportDTO.politicalOutlook != null'>" + "AND cmp.political_outlook = #{populationExportDTO.politicalOutlook} " + " </if> " + " ) as population where 1=1 " + "<if test='populationExportDTO.eventStatus != null'>" + "AND population.eventStatus = #{populationExportDTO.eventStatus} " + " </if> " + " </script>") + "AND cmp.political_outlook = #{populationExportDTO.politicalOutlook} " + " </if> " + " </script>") List<ComMngPopulationListVO> getGridPopulationAdminLists(@Param("populationExportDTO") ComMngPopulationExportDTO populationExportDTO); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComCorrectPopulationDO.java
@@ -197,7 +197,7 @@ /** * 学历 */ private Integer cultureLevel; private String cultureLevel; /** * 社区矫正人员编号 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMajorPopulationDO.java
@@ -77,7 +77,7 @@ /** * 与监护人关系 */ private Integer custodyRelation; private String custodyRelation; /** * 监护人公民身份号码 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComRehabilitationPopulationDO.java
@@ -62,7 +62,7 @@ /** * 与人员关系 */ private Integer patientRelation; private String patientRelation; /** * 列管原因及类型 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComSwDangerReportDO.java
@@ -22,7 +22,7 @@ /** * 主键id */ @TableId(type = IdType.INPUT) @TableId(value = "id",type = IdType.INPUT) private Long id; /** springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComVeteransPopulationDO.java
@@ -75,9 +75,9 @@ private String photo; /** * 户籍性质(1.城镇户口 2.农村户口) * 户籍性质 */ private Integer regiterNature; private String regiterNature; /** * 入伍时间 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActActivityService.java
@@ -6,12 +6,11 @@ import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityListDTO; import com.panzhihua.common.model.dtos.community.bigscreen.work.ScreenActActivityPeopleListDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComActActRegistVO; import com.panzhihua.common.model.vos.community.ActivitySignVO; import com.panzhihua.common.model.vos.community.ComActActEvaluateVO; import com.panzhihua.common.model.vos.community.ComActActivityVO; import com.panzhihua.common.model.vos.community.SignactivityVO; import com.panzhihua.common.model.vos.community.*; import com.panzhihua.service_community.model.dos.ComActActivityDO; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** * @program: springcloud_k8s_panzhihuazhihuishequ @@ -95,22 +94,58 @@ R listActivitySigns(ActivitySignVO activitySignVO); /** * description getSignLists 查询活动报名名单 * @param activitySignVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ R getSignLists(ActivitySignVO activitySignVO); /** * description listActivityRegists 分页查询活动评价 * @param comActActEvaluateVO 活动评价vo * @return R 分页查询结果 * @author txb * @date 2021/8/24 14:03 */ R pageActivityRegists(ComActActEvaluateVO comActActEvaluateVO); R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO); /** * description getEvaluateListsByIds 批量查询活动评价 * @param ids ids * description getEvaluateLists 查询活动评价 * @param comActActEvaluateVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ R getEvaluateListsByIds(List<Long> ids); R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO); /** * description pageActivityRegists 分页查询活动签到 * @param comActActRegistVO 活动签到vo * @return R 分页查询结果 * @author txb * @date 2021/8/24 14:03 */ R pageActivityRegists(ComActActRegistVO comActActRegistVO); /** * description getRegistLists 查询活动签到 * @param comActActRegistVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/25 9:33 */ R getRegistLists(ComActActRegistVO comActActRegistVO); /** * description activityStagistics 活动数据统计 * @param activityId 活动id * @return R 统计结果 * @author txb * @date 2021/8/25 13:33 */ R activityStatistics(Long activityId); /** * 分页展示我的所有活动 时间倒序排列 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActActivityServiceImpl.java
@@ -1,15 +1,15 @@ package com.panzhihua.service_community.service.impl; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; import java.text.DecimalFormat; import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import javax.annotation.Resource; import com.panzhihua.service_community.dao.ComActActEvaluateDAO; import com.panzhihua.service_community.dao.ComActActRegistDAO; import com.panzhihua.service_community.model.dos.ComActActEvaluateDO; import org.apache.commons.lang3.time.DateUtils; import org.springframework.beans.BeanUtils; import org.springframework.data.redis.core.StringRedisTemplate; @@ -72,9 +72,9 @@ @Resource private ComActActEvaluateDAO comActActEvaluateDAO; @Resource private StringRedisTemplate stringRedisTemplate; @Resource private ComActActRegistDAO comActActRegistDAO; @Resource private StringRedisTemplate stringRedisTemplate; /** * 新增社区活动 @@ -291,15 +291,50 @@ } @Override public R pageActivityRegists(ComActActEvaluateVO comActActEvaluateVO) { public R getSignLists(ActivitySignVO activitySignVO) { return R.ok(comActActSignDAO.getSignLists(activitySignVO)); } @Override public R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO) { IPage<ComActActEvaluateVO> comActActEvaluateVOIPage = comActActEvaluateDAO .pageActivityRegists(new Page(comActActEvaluateVO.getPageNum(), comActActEvaluateVO.getPageSize()), comActActEvaluateVO); .pageActivityEvaluates(new Page(comActActEvaluateVO.getPageNum(), comActActEvaluateVO.getPageSize()), comActActEvaluateVO); return R.ok(comActActEvaluateVOIPage); } @Override public R getEvaluateListsByIds(List<Long> ids) { return R.ok(comActActEvaluateDAO.getEvaluateListsByIds(ids)); public R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO) { return R.ok(comActActEvaluateDAO.getEvaluateLists(comActActEvaluateVO)); } @Override public R pageActivityRegists(ComActActRegistVO comActActRegistVO) { IPage<ComActActRegistVO> comActActRegistVOIPage = comActActRegistDAO.pageActivityRegists(new Page(comActActRegistVO.getPageNum(), comActActRegistVO.getPageSize()), comActActRegistVO); return R.ok(comActActRegistVOIPage); } @Override public R getRegistLists(ComActActRegistVO comActActRegistVO) { return R.ok(comActActRegistDAO.getRegistLists(comActActRegistVO)); } @Override public R activityStatistics(Long activityId) { ComActActivityStatisticsVO comActActivityStatisticsVO = comActActivityDAO.activityStatistics(activityId); if (comActActivityStatisticsVO != null) { if (comActActivityStatisticsVO.getSignTotal().equals(0)){ comActActivityStatisticsVO.setSignTotalStr("不限"); comActActivityStatisticsVO.setNoSignTotalStr(""); comActActivityStatisticsVO.setSignPersent(""); }else { comActActivityStatisticsVO.setSignTotalStr(String.valueOf(comActActivityStatisticsVO.getSignTotal())); comActActivityStatisticsVO.setNoSignTotalStr(String.valueOf(Integer.valueOf(comActActivityStatisticsVO.getSignTotalStr()) - comActActivityStatisticsVO.getReallySignTotal())); comActActivityStatisticsVO.setSignPersent(getPersent(comActActivityStatisticsVO.getReallySignTotal(),comActActivityStatisticsVO.getSignTotal())); } comActActivityStatisticsVO.setRegistPersent(getPersent(comActActivityStatisticsVO.getReallyRegistTotal(),comActActivityStatisticsVO.getRegistTotal())); comActActivityStatisticsVO.setEvaluatePersent(getPersent(comActActivityStatisticsVO.getReallyEvaluateTotal(),comActActivityStatisticsVO.getEvaluateTotal())); } return R.ok(comActActivityStatisticsVO); } /** @@ -645,6 +680,19 @@ return R.ok(); } private String getPersent(int x, int y){ if (y == 0) { return ""; } if (x == 0) { return "0.00%"; } double d1 = x * 1.0; double d2 = y * 1.0; DecimalFormat decimalFormat = new DecimalFormat("##.00%"); return decimalFormat.format(d1 / d2); } /** * 用户签到 * springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActDiscussServiceImpl.java
@@ -469,7 +469,9 @@ .collect(Collectors.toList()); if (!ObjectUtils.isEmpty(collect)) { String userName = collect.get(0).getUserName(); String userNickName = collect.get(0).getUserNickName(); comActDiscussCommentVO1.setUserNameBack(userName); comActDiscussCommentVO1.setUserNickNameBack(userNickName); } List<ComActDiscussCommentVO> collect1 = records.stream() .filter(comActDiscussCommentVO2 -> comActDiscussCommentVO2.getId().equals(parentId)) springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComActEasyPhotoServiceImpl.java
@@ -288,8 +288,8 @@ cmActEasyPhotoDO.setTransferTime(nowDate); } else { cmActEasyPhotoDO.setIsReportUrban(ComActEasyPhotoVO.isReportUrban.no); cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getHandlerId()); } cmActEasyPhotoDO.setHandlerId(comActEasyPhotoVO.getHandlerId()); cmActEasyPhotoDO.setExamineAt(nowDate); cmActEasyPhotoDO.setActivityType(comActEasyPhotoVO.getActivityType()); if (StringUtils.isNotEmpty(comActEasyPhotoVO.getHandleResult()) springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -751,29 +751,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -811,7 +811,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -1046,29 +1046,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationDrugMistakeExcelVO mistake = new ComMngPopulationDrugMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setDrugMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationDrugMistakeExcelVO mistake = new ComMngPopulationDrugMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setDrugMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -1106,7 +1106,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -1341,29 +1341,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationCorrectMistakeExcelVO mistake = new ComMngPopulationCorrectMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setCorrectMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationCorrectMistakeExcelVO mistake = new ComMngPopulationCorrectMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setCorrectMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -1401,7 +1401,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -1636,29 +1636,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationMajorMistakeExcelVO mistake = new ComMngPopulationMajorMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setMajorMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationMajorMistakeExcelVO mistake = new ComMngPopulationMajorMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setMajorMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -1696,7 +1696,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -1931,29 +1931,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationCultMistakeExcelVO mistake = new ComMngPopulationCultMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setCultMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationCultMistakeExcelVO mistake = new ComMngPopulationCultMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setCultMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -1991,7 +1991,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -2228,30 +2228,30 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationRehabilitationMistakeExcelVO mistake = new ComMngPopulationRehabilitationMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setRehabilitationMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationRehabilitationMistakeExcelVO mistake = new ComMngPopulationRehabilitationMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setRehabilitationMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -2289,7 +2289,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -2524,29 +2524,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationKeyMistakeExcelVO mistake = new ComMngPopulationKeyMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setKeyMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationKeyMistakeExcelVO mistake = new ComMngPopulationKeyMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setKeyMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -2584,7 +2584,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -2819,29 +2819,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationSentenceMistakeExcelVO mistake = new ComMngPopulationSentenceMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setSentenceMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationSentenceMistakeExcelVO mistake = new ComMngPopulationSentenceMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setSentenceMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -2879,7 +2879,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -3114,29 +3114,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setVeteransMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationVeteransMistakeExcelVO mistake = new ComMngPopulationVeteransMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setVeteransMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -3174,7 +3174,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -3409,29 +3409,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationDisabilityMistakeExcelVO mistake = new ComMngPopulationDisabilityMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setDisabilityMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationDisabilityMistakeExcelVO mistake = new ComMngPopulationDisabilityMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setDisabilityMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -3469,7 +3469,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -3709,29 +3709,29 @@ populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey); List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]) .collect(Collectors.toList()); // 如果导入数据标签中有当前社区标签列表中不包含的标签,则删除 Iterator<String> iterator = userTag.iterator(); while (iterator.hasNext()) { String s = iterator.next(); if (!labelList.contains(s)) iterator.remove(); } comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); comMngPopulationCommunityTagsDO.setUpdateBy(userId); updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO); ComMngPopulationLowSecurityMistakeExcelVO mistake = new ComMngPopulationLowSecurityMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setLowSecurityMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); ComMngPopulationLowSecurityMistakeExcelVO mistake = new ComMngPopulationLowSecurityMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setLowSecurityMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } @@ -3769,7 +3769,7 @@ } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); @@ -5786,7 +5786,7 @@ userTagList.forEach(userTag -> { if (userTag != null) { if (userTag.getSysFlag().equals(0)) { Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); otherSpecialVO.setSum(otherSpecialVO.getSum() + count); } else { if (StringUtils.isNotEmpty(userTag.getTagName())) { @@ -5818,7 +5818,7 @@ } else { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); specialStatisticsVO.setSum(count); specialStatisticsVOList.add(specialStatisticsVO); } @@ -5999,7 +5999,7 @@ userTagList.forEach(userTag -> { if (userTag != null) { if (userTag.getSysFlag().equals(0)) { Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); otherSpecialVO.setSum(otherSpecialVO.getSum() + count); } else { if (StringUtils.isNotEmpty(userTag.getTagName())) { @@ -6031,7 +6031,7 @@ } else { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); specialStatisticsVO.setSum(count); specialStatisticsVOList.add(specialStatisticsVO); } @@ -6099,7 +6099,7 @@ userTagList.forEach(userTag -> { if (userTag != null) { if (userTag.getSysFlag().equals(0)) { Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); otherSpecialVO.setSum(otherSpecialVO.getSum() + count); } else { if (StringUtils.isNotEmpty(userTag.getTagName())) { @@ -6131,7 +6131,7 @@ } else { IndexSpecialStatisticsVO specialStatisticsVO = new IndexSpecialStatisticsVO(); specialStatisticsVO.setTitle(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName()); Integer count = comMngPopulationDAO.getSpecialStatisticsByLabel(userTag.getTagName(),communityId); specialStatisticsVO.setSum(count); specialStatisticsVOList.add(specialStatisticsVO); } @@ -6661,7 +6661,7 @@ mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); // mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); // mvo.setMarriage(PopulMarriageEnum.getCnDescByName(vo.getMarriage())); mvo.setOutOrLocal(PopulOutOrLocalEnum.getCnDescByName(vo.getOutOrLocal())); mvo.setIsCorrectGroup(PopulHouseUseEnum.getCnDescByName(vo.getIsCorrectGroup())); @@ -6677,7 +6677,7 @@ private void setMajorMistake(ComMngPopulationMajorMistakeExcelVO mvo, ComMngPopulationMajorExcelVO vo) { // mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); mvo.setCustodyRelation(PopulRelationEnum.getCnDescByName(vo.getCustodyRelation())); // mvo.setCustodyRelation(PopulRelationEnum.getCnDescByName(vo.getCustodyRelation())); // mvo.setRelation(PopulRelationEnum.getCnDescByName(vo.getRelation())); mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); @@ -6711,7 +6711,7 @@ ComMngPopulationRehabilitationExcelVO vo) { // mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); // mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); @@ -6759,7 +6759,7 @@ } private void setVeteransMistake(ComMngPopulationVeteransMistakeExcelVO mvo, ComMngPopulationVeteransExcelVO vo) { mvo.setRegiterNature(PopulRegiterNatureEnum.getCnDescByName(vo.getRegiterNature())); // mvo.setRegiterNature(PopulRegiterNatureEnum.getCnDescByName(vo.getRegiterNature())); mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); // mvo.setPatientRelation(PopulRelationEnum.getCnDescByName(vo.getPatientRelation())); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwDangerReportServiceImpl.java
@@ -341,15 +341,27 @@ @Override public R exportDangerReport(List<Long> dangerReportIds) { List<ComSwDangerReportExcelVO> list = comSwDangerReportDAO.exportDangerReport(dangerReportIds); // list.forEach(comSwDangerReportExcelVO -> { // List<String> patrolUserIds = Arrays.asList(comSwDangerReportExcelVO.getPatrolPerson().split(",")); // List<String> patrolPhones = new ArrayList<>(); // for (String userId : patrolUserIds) { // LoginUserInfoVO loginUserInfoVO = userService.getUserInfoByUserId(userId).getData(); // patrolPhones.add(loginUserInfoVO.getPhone()); // } // comSwDangerReportExcelVO.setPatrolPersonPhone(StringUtils.join(patrolPhones,",")); // }); list.forEach(comSwDangerReportExcelVO -> { // 整改人员id查询整改人员的名字和电话 StringBuilder dangerNameString = new StringBuilder(); StringBuilder dangerPhoneString = new StringBuilder(); if (StringUtils.isNotEmpty(comSwDangerReportExcelVO.getDpersonName())) { String[] dangerIds = comSwDangerReportExcelVO.getDpersonName().split(","); for (int i = 0; i < dangerIds.length; i++) { Map<String, String> person = comSwPatrolRecordDAO.getPbServiceTeamById(dangerIds[i]); if (person != null) { if (i != 0) { dangerNameString.append(","); dangerPhoneString.append(","); } dangerNameString.append(person.get("name")); dangerPhoneString.append(person.get("phone")); } } comSwDangerReportExcelVO.setDpersonName(dangerNameString.toString()); comSwDangerReportExcelVO.setDpersonPhone(dangerPhoneString.toString()); } }); return R.ok(list); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComSwPatrolRecordServiceImpl.java
@@ -93,7 +93,7 @@ BeanUtils.copyProperties(comSwPatrolRecordAddDTO, comSwPatrolRecordDO); Long patrolRecordId = Snowflake.getId(); comSwPatrolRecordDO.setId(patrolRecordId); comSwPatrolRecordDO.setPatrolTime(new Date()); // comSwPatrolRecordDO.setPatrolTime(new Date()); comSwPatrolRecordDO.setSuccessionTime( DateUtils.stringToDate(comSwPatrolRecordAddDTO.getSuccessionTime(), DateUtils.yyyyMMdd_format)); StringBuilder nameString = new StringBuilder(); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActEvaluateMapper.xml
@@ -19,7 +19,7 @@ id, activity_id, user_id, create_at, is_volunteer, star_level, evaluate_content, photo </sql> <select id="pageActivityRegists" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> <select id="pageActivityEvaluates" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateVO"> SELECT caae.id, caae.activity_id, @@ -62,7 +62,7 @@ order by caae.create_at desc </select> <select id="getEvaluateListsByIds" resultType="java.util.List"> <select id="getEvaluateLists" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO"> SELECT caae.create_at, caae.star_level, @@ -81,10 +81,19 @@ com_act_act_evaluate caae LEFT JOIN com_act_act_sign caas ON caae.activity_id = caas.activity_id LEFT JOIN sys_user su ON caae.user_id = su.user_id where caae.id in <foreach collection="ids" item="id" open="(" close=")" separator=","> #{id} </foreach> where caae.activity_id = #{comActActEvaluateVO.activityId} <if test="comActActEvaluateVO.phone != null and comActActEvaluateVO.phone !=''"> AND su.phone = #{comActActEvaluateVO.phone} </if> <if test="comActActEvaluateVO.name != null and comActActEvaluateVO.name !=''"> AND su.`name` = #{comActActEvaluateVO.name} </if> <if test="comActActEvaluateVO.starLevel != null"> AND caae.star_level = #{comActActEvaluateVO.starLevel} </if> <if test="comActActEvaluateVO.createAt != null"> AND caae.create_at = #{comActActEvaluateVO.createAt} </if> order by caae.create_at desc </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActRegistMapper.xml
@@ -16,4 +16,71 @@ id, activity_id, user_id, create_at, is_volunteer </sql> <select id="pageActivityRegists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistVO"> SELECT caar.id, caar.activity_id, caar.create_at, su.user_id, su.`name`, su.nick_name, su.phone, su.image_url, su.tags, caar.is_volunteer, CASE WHEN su.is_partymember = 1 THEN '党员' WHEN caas.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity FROM com_act_act_regist caar LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id LEFT JOIN sys_user su ON caar.user_id = su.user_id where caar.activity_id = #{comActActRegistVO.activityId} <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> AND su.phone = #{comActActRegistVO.phone} </if> <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> AND su.`name` = #{comActActRegistVO.name} </if> <if test="comActActRegistVO.createAt != null"> AND caar.create_at = #{comActActRegistVO.createAt} </if> order by caar.create_at desc </select> <select id="getRegistLists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistExcelVO"> SELECT caar.create_at, su.`name`, su.phone, su.tags, CASE WHEN su.is_partymember = 1 THEN '党员' WHEN caas.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity FROM com_act_act_regist caar LEFT JOIN com_act_act_sign caas ON caar.activity_id = caas.activity_id LEFT JOIN sys_user su ON caar.user_id = su.user_id where caar.activity_id = #{comActActRegistVO.activityId} <if test="comActActRegistVO.phone != null and comActActRegistVO.phone !=''"> AND su.phone = #{comActActRegistVO.phone} </if> <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> AND su.`name` = #{comActActRegistVO.name} </if> <if test="comActActRegistVO.createAt != null"> AND caar.create_at = #{comActActRegistVO.createAt} </if> order by caar.create_at desc </select> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActSignMapper.xml
@@ -15,6 +15,38 @@ <sql id="Base_Column_List"> id, activity_id, user_id, create_at, is_volunteer </sql> <select id="getSignLists" resultType="com.panzhihua.common.model.vos.community.ComActActSignExcelVO"> SELECT caas.create_at, su.`name`, su.phone, su.tags, CASE WHEN su.is_partymember = 1 THEN '党员' WHEN caas.is_volunteer = 1 THEN '志愿者' ELSE '居民' END identity FROM com_act_act_sign caas LEFT JOIN sys_user su ON caas.user_id = su.user_id where caas.activity_id = #{activitySignVO.activityId} <if test="activitySignVO.phone != null and activitySignVO.phone !=''"> AND su.phone = #{activitySignVO.phone} </if> <if test="activitySignVO.name != null and activitySignVO.name !=''"> AND su.`name` = #{activitySignVO.name} </if> <if test="activitySignVO.createAt != null and activitySignVO.createAt !=''"> AND caas.create_at = #{activitySignVO.createAt} </if> <if test="activitySignVO.tags != null and activitySignVO.tags !=''"> AND su.tags like concat('%', #{activitySignVO.tags}, '%') </if> order by caas.create_at desc <select id="selectNeedEvaluateSignRecords" resultMap="BaseResultMap"> SELECT s.id,s.activity_id,s.user_id,s.create_at,s.is_volunteer FROM `com_act_act_sign` s springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
@@ -2,47 +2,56 @@ <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_community.dao.ComActActivityDAO"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActivityDO"> <id column="id" property="id" /> <result column="activity_name" property="activityName" /> <result column="sponsor_id" property="sponsorId" /> <result column="activity_addr" property="activityAddr" /> <result column="lat" property="lat" /> <result column="lng" property="lng" /> <result column="status" property="status" /> <result column="publish_at" property="publishAt" /> <result column="end_at" property="endAt" /> <result column="begin_at" property="beginAt" /> <result column="sign_up_begin" property="signUpBegin" /> <result column="sign_up_end" property="signUpEnd" /> <result column="aattend_people" property="aattendPeople" /> <result column="volunteer_min" property="volunteerMin" /> <result column="volunteer_max" property="volunteerMax" /> <result column="participant_min" property="participantMin" /> <result column="participant_max" property="participantMax" /> <result column="cover" property="cover" /> <result column="has_prize" property="hasPrize" /> <result column="is_qr_code" property="isQrCode" /> <result column="contact_name" property="contactName" /> <result column="contact_phone" property="contactPhone" /> <result column="is_regist" property="isRegist" /> <result column="is_top" property="isTop" /> <result column="prize_remark" property="prizeRemark" /> <result column="reward_desc" property="rewardDesc" /> <result column="content" property="content" /> <result column="create_at" property="createAt" /> <result column="cancel_reason" property="cancelReason" /> <result column="community_id" property="communityId" /> <result column="is_default_praise" property="isDefaultPraise" /> </resultMap> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActivityDO"> <id column="id" property="id" /> <result column="activity_name" property="activityName" /> <result column="sponsor_id" property="sponsorId" /> <result column="activity_addr" property="activityAddr" /> <result column="lat" property="lat" /> <result column="lng" property="lng" /> <result column="status" property="status" /> <result column="publish_at" property="publishAt" /> <result column="end_at" property="endAt" /> <result column="begin_at" property="beginAt" /> <result column="sign_up_begin" property="signUpBegin" /> <result column="sign_up_end" property="signUpEnd" /> <result column="aattend_people" property="aattendPeople" /> <result column="volunteer_min" property="volunteerMin" /> <result column="volunteer_max" property="volunteerMax" /> <result column="participant_min" property="participantMin" /> <result column="participant_max" property="participantMax" /> <result column="cover" property="cover" /> <result column="has_prize" property="hasPrize" /> <result column="is_qr_code" property="isQrCode" /> <result column="contact_name" property="contactName" /> <result column="contact_phone" property="contactPhone" /> <result column="is_regist" property="isRegist" /> <result column="is_top" property="isTop" /> <result column="prize_remark" property="prizeRemark" /> <result column="reward_desc" property="rewardDesc" /> <result column="content" property="content" /> <result column="community_id" property="communityId" /> <result column="create_at" property="createAt" /> <result column="cancel_reason" property="cancelReason" /> </resultMap> <!-- 通用查询结果列 --> <sql id="Base_Column_List"> id, activity_name, sponsor_id, activity_addr, lat, lng, status, publish_at, end_at, begin_at, sign_up_begin, sign_up_end, aattend_people, volunteer_min, volunteer_max, participant_min, participant_max, cover, has_prize, is_qr_code, contact_name, contact_phone, is_regist, is_top, prize_remark, reward_desc, content, create_at, cancel_reason, community_id, is_default_praise id, activity_name, sponsor_id, activity_addr, lat, lng, status, publish_at, end_at, begin_at, sign_up_begin, sign_up_end, aattend_people, volunteer_min, volunteer_max, participant_min, participant_max, cover, has_prize, is_qr_code, contact_name, contact_phone, is_regist, is_top, prize_remark, reward_desc, content, community_id, create_at, cancel_reason </sql> <select id="activityStatistics" resultType="com.panzhihua.common.model.vos.community.ComActActivityStatisticsVO"> SELECT IFNULL(volunteer_max,0) + IFNULL(participant_max,0) as signTotal ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as reallySignTotal ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as registTotal ,(SELECT count(id) FROM com_act_act_regist WHERE activity_id = #{activityId}) as reallyRegistTotal ,((SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) - (SELECT count(id) FROM com_act_act_regist WHERE activity_id = #{activityId})) as noRegistTotal ,(SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) as evaluateTotal ,(SELECT count(id) FROM com_act_act_evaluate WHERE activity_id = #{activityId}) as reallyEvaluateTotal ,((SELECT count(id) FROM com_act_act_sign WHERE activity_id = #{activityId}) - (SELECT count(id) FROM com_act_act_evaluate WHERE activity_id = #{activityId})) as noEvaluateTotal FROM com_act_activity where id = #{activityId} </select> <select id="getIndexTopActivityList" resultMap="BaseResultMap"> SELECT * FROM `com_act_activity` WHERE community_id = #{communityId} and is_top = 1 and end_at >= now() and begin_at <= now() springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActEasyPhotoDOMapper.xml
@@ -89,6 +89,9 @@ <if test='comActEasyPhotoVO.isReportUrban != null' > AND p.`is_report_urban` = #{comActEasyPhotoVO.isReportUrban} </if> <if test='comActEasyPhotoVO.classifyId != null' > AND p.`classify_id` = #{comActEasyPhotoVO.classifyId} </if> <if test='comActEasyPhotoVO.urbanStatus != null' > AND p.`urban_status` = #{comActEasyPhotoVO.urbanStatus} </if> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationCommunityTagsMapper.xml
@@ -19,4 +19,21 @@ id, population_id, community_id, label, create_at, create_by, update_at, update_by </sql> <update id="updateAll" parameterType="java.util.List"> <foreach collection="comMngPopulationCommunityTagsDOS" item="item" index="index" separator=";"> update com_mng_population_community_tags <set> <if test="item.label != null"> `label` = #{item.label}, </if> <if test="item.updateBy != null"> `update_by` = #{item.updateBy}, </if> `update_at` = NOW() </set> WHERE `id` = #{item.id} </foreach> ; </update> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComSwDangerReportMapper.xml
@@ -137,13 +137,33 @@ <select id="exportDangerReport" resultType="com.panzhihua.common.model.vos.community.ComSwDangerReportExcelVO" parameterType="java.util.List"> SELECT cspr.person_name AS personName, cspr.person_phone AS personPhone, cspr.person_name AS ppersonName, cspr.person_phone AS ppersonPhone, cspr.address, csdr.remark, csdr.dager_description AS dagerDescription, csdr.danger_type AS dangerType, csdr.danger_level AS dangerLevel case csdr.danger_type when '1' then '火灾隐患' when '2' then '汛情隐患' when '3' then '疫情隐患' end AS dangerType, case csdr.status when '1' then '待处理' when '2' then '待整改' when '3' then '已整改' end AS status, case csdr.danger_level when '1' then '红色预警' when '2' then '橙色预警' when '3' then '黄色预警' when '4' then '蓝色预警' end AS dangerLevel, cspr.create_at AS createAt, csdr.rectify_person AS dpersonName, csdr.rectify_time AS rectifyTime FROM com_sw_danger_report as csdr left join com_sw_patrol_record_report as csprr on csprr.report_id = csdr.id