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/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/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/service/community/CommunityService.java
@@ -143,6 +143,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 分页查询结果 @@ -153,14 +163,44 @@ 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/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/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,7 +221,61 @@ 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 pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { if (ObjectUtils.isEmpty(comActActEvaluateVO.getActivityId())) { @@ -225,10 +286,10 @@ @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
@@ -372,6 +372,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 分页查询结果 @@ -381,6 +393,18 @@ @PostMapping("activity/evaluate/page") public R pageActivityEvaluates(@RequestBody ComActActEvaluateVO comActActEvaluateVO) { return comActActivityService.pageActivityEvaluates(comActActEvaluateVO); } /** * description getEvaluateLists 查询活动评价 * @param comActActEvaluateVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ @PostMapping("activity/evaluate/getList") public R getEvaluateLists(@RequestBody ComActActEvaluateVO comActActEvaluateVO){ return comActActivityService.getEvaluateLists(comActActEvaluateVO); } /** @@ -396,15 +420,27 @@ } /** * description getEvaluateListsByIds 批量查询活动评价 * @param ids ids * description getRegistLists 查询活动签到 * @param comActActRegistVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 * @date 2021/8/25 9:33 */ @PostMapping("/activity/evaluate/getList") public R getEvaluateListsByIds(@RequestBody List<Long> ids){ return comActActivityService.getEvaluateListsByIds(ids); @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
@@ -26,6 +26,6 @@ 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
@@ -3,10 +3,14 @@ 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类 @@ -21,4 +25,6 @@ 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; @@ -193,4 +194,6 @@ + "FROM " + " com_act_act_sign AS caas " + " LEFT JOIN sys_user AS su ON su.user_id = caas.user_id " + "WHERE " + " su.is_volunteer = 1 " + " AND activity_id = #{activityId} ") ActActivityListVO getScreenActActivityPeopleCount(@Param("activityId") Long activityId); ComActActivityStatisticsVO activityStatistics (@Param("activityId") Long activityId); } 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, " springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComActActivityService.java
@@ -10,6 +10,7 @@ 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 @@ -93,6 +94,15 @@ 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 分页查询结果 @@ -100,6 +110,15 @@ * @date 2021/8/24 14:03 */ R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO); /** * description getEvaluateLists 查询活动评价 * @param comActActEvaluateVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 */ R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO); /** * description pageActivityRegists 分页查询活动签到 @@ -111,13 +130,22 @@ R pageActivityRegists(ComActActRegistVO comActActRegistVO); /** * description getEvaluateListsByIds 批量查询活动评价 * @param ids ids * description getRegistLists 查询活动签到 * @param comActActRegistVO 查询参数 * @return R 查询结果 * @author txb * @date 2021/8/24 14:03 * @date 2021/8/25 9:33 */ R getEvaluateListsByIds(List<Long> ids); 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,5 +1,6 @@ package com.panzhihua.service_community.service.impl; import java.text.DecimalFormat; import java.util.*; import java.util.stream.Collectors; @@ -273,10 +274,20 @@ } @Override public R getSignLists(ActivitySignVO activitySignVO) { return R.ok(comActActSignDAO.getSignLists(activitySignVO)); } @Override public R pageActivityEvaluates(ComActActEvaluateVO comActActEvaluateVO) { IPage<ComActActEvaluateVO> comActActEvaluateVOIPage = comActActEvaluateDAO .pageActivityEvaluates(new Page(comActActEvaluateVO.getPageNum(), comActActEvaluateVO.getPageSize()), comActActEvaluateVO); return R.ok(comActActEvaluateVOIPage); } @Override public R getEvaluateLists(ComActActEvaluateVO comActActEvaluateVO) { return R.ok(comActActEvaluateDAO.getEvaluateLists(comActActEvaluateVO)); } @Override @@ -286,8 +297,27 @@ } @Override public R getEvaluateListsByIds(List<Long> ids) { return R.ok(comActActEvaluateDAO.getEvaluateListsByIds(ids)); 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); } /** @@ -633,4 +663,17 @@ 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/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); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActEvaluateMapper.xml
@@ -62,7 +62,7 @@ order by caae.create_at desc </select> <select id="getEvaluateListsByIds" resultType="com.panzhihua.common.model.vos.community.ComActActEvaluateExcelVO"> <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
@@ -18,19 +18,16 @@ <select id="pageActivityRegists" resultType="com.panzhihua.common.model.vos.community.ComActActRegistVO"> SELECT caae.id, caae.activity_id, caae.create_at, caae.photo, caae.star_level, caae.evaluate_content, caar.id, caar.activity_id, caar.create_at, su.user_id, su.`name`, su.nick_name, su.phone, su.image_url, su.tags, caae.is_volunteer, caar.is_volunteer, CASE WHEN su.is_partymember = 1 THEN @@ -40,22 +37,50 @@ END identity FROM 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.activity_id = #{comActActEvaluateVO.activityId} <if test="comActActEvaluateVO.phone != null and comActActEvaluateVO.phone !=''"> AND su.phone = #{comActActEvaluateVO.phone} 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="comActActEvaluateVO.name != null and comActActEvaluateVO.name !=''"> AND su.`name` = #{comActActEvaluateVO.name} <if test="comActActRegistVO.name != null and comActActRegistVO.name !=''"> AND su.`name` = #{comActActRegistVO.name} </if> <if test="comActActEvaluateVO.starLevel != null"> AND caae.star_level = #{comActActEvaluateVO.starLevel} <if test="comActActRegistVO.createAt != null"> AND caar.create_at = #{comActActRegistVO.createAt} </if> <if test="comActActEvaluateVO.createAt != null"> AND caae.create_at = #{comActActEvaluateVO.createAt} 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> order by caae.create_at desc <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
New file @@ -0,0 +1,51 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.panzhihua.service_community.dao.ComActActSignDAO"> <!-- 通用查询映射结果 --> <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComActActSignDO"> <id column="id" property="id" /> <result column="activity_id" property="activityId" /> <result column="user_id" property="userId" /> <result column="create_at" property="createAt" /> <result column="is_volunteer" property="isVolunteer" /> </resultMap> <!-- 通用查询结果列 --> <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> </mapper> springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComActActivityMapper.xml
New file @@ -0,0 +1,55 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.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="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, 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> </mapper> 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>