From 7728c5365d56abe63b90ed46ad101a0d8a6edcfc Mon Sep 17 00:00:00 2001 From: wanggeng888 <450292408@qq.com> Date: Wed, 16 Jun 2021 11:30:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommunityBossController.java | 23 -- .../communityboss/ICommunityBossService.java | 10 - .../impl/CommunityBossServiceImpl.java | 166 ------------ .../com/cm/systemcity/util/ExcelUtil.java | 248 ------------------ src/main/resources/application-test.yml | 2 +- src/main/resources/application.properties | 1 - .../communityboss/communityboss-mapper.xml | 97 ++----- .../SystemCityApplicationTests.java | 2 +- 8 files changed, 22 insertions(+), 527 deletions(-) delete mode 100644 src/main/java/com/cm/systemcity/util/ExcelUtil.java delete mode 100644 src/main/resources/application.properties diff --git a/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java b/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java index 898bc8a..2336af4 100755 --- a/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java +++ b/src/main/java/com/cm/systemcity/controller/apis/communityboss/CommunityBossController.java @@ -1,6 +1,5 @@ package com.cm.systemcity.controller.apis.communityboss; -import com.alibaba.fastjson.JSONObject; import com.cm.common.base.AbstractController; import com.cm.common.constants.ISystemConstant; import com.cm.common.exception.*; @@ -11,16 +10,12 @@ import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.systemcity.pojo.dtos.community.CommunityDTO; import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossDTO; -import com.cm.systemcity.pojo.vos.communityboss.CommunityBossExcelVO; import com.cm.systemcity.pojo.vos.communityboss.CommunityBossVO; import com.cm.systemcity.service.communityboss.ICommunityBossService; -import com.cm.systemcity.util.ExcelUtil; import io.swagger.annotations.*; import org.apache.commons.lang3.StringUtils; -import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; import java.util.List; import java.util.Map; @@ -39,24 +34,6 @@ public class CommunityBossController extends AbstractController { @Autowired private ICommunityBossService communityBossService; - @Autowired - private ExcelUtil excelUtil; - - - - - @PostMapping(value = "/uploadExcel", consumes = "multipart/*", headers = "content-type=multipart/form-data") - @ApiOperation(value = "片长信息Excel导入数据", notes = "片长信息Excel导入数据", httpMethod = "POST") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "上传成功!" ,response = SuccessResult.class), - @ApiResponse(code = 500, message = "上传失败!" ,response = ErrorResult.class) - }) - public SuccessResultData uploadExcel(@ApiParam(value = "用户信息Excel导入数据", required = true) MultipartFile file) throws Exception { - List dtoList = excelUtil.readExcelFileToDTO(file, CommunityBossExcelVO.class); - return communityBossService.saveExcelCommunutyBoos(dtoList); - } - - @ApiOperation(value = "片长新增", notes = "片长新增接口") @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) diff --git a/src/main/java/com/cm/systemcity/service/communityboss/ICommunityBossService.java b/src/main/java/com/cm/systemcity/service/communityboss/ICommunityBossService.java index af7cbed..a41e9cf 100755 --- a/src/main/java/com/cm/systemcity/service/communityboss/ICommunityBossService.java +++ b/src/main/java/com/cm/systemcity/service/communityboss/ICommunityBossService.java @@ -31,16 +31,6 @@ public interface ICommunityBossService { int COMMUNITY_BOSS_LEVEL_2 = 2; int COMMUNITY_BOSS_LEVEL_3 = 3; - - - /** - * 导入EXCEL - * @param excelVOList - * @return - * @throws Exception - */ - SuccessResultData saveExcelCommunutyBoos(List excelVOList) throws Exception; - /** * 新增片长 * diff --git a/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java b/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java index 51a9dc7..77894ab 100755 --- a/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java +++ b/src/main/java/com/cm/systemcity/service/communityboss/impl/CommunityBossServiceImpl.java @@ -1,6 +1,5 @@ package com.cm.systemcity.service.communityboss.impl; -import com.alibaba.fastjson.JSONObject; import com.cm.common.base.AbstractService; import com.cm.common.constants.ISystemConstant; import com.cm.common.exception.RemoveException; @@ -8,28 +7,22 @@ import com.cm.common.exception.SaveException; import com.cm.common.exception.SearchException; import com.cm.common.exception.UpdateException; import com.cm.common.plugin.oauth.service.user.IUserService; -import com.cm.common.plugin.pojo.bos.UserResourceBO; -import com.cm.common.plugin.service.file.IFileService; import com.cm.common.pojo.ListPage; import com.cm.common.result.SuccessResult; import com.cm.common.result.SuccessResultData; import com.cm.common.result.SuccessResultList; import com.cm.common.token.app.AppTokenManager; -import com.cm.common.utils.UUIDUtil; import com.cm.systemcity.dao.communityboss.ICommunityBossDao; import com.cm.systemcity.pojo.dtos.citybuilding.CityBuildingDTO; import com.cm.systemcity.pojo.dtos.citydistrict.CityDistrictDTO; import com.cm.systemcity.pojo.dtos.community.CommunityDTO; import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossAreaDTO; import com.cm.systemcity.pojo.dtos.communityboss.CommunityBossDTO; -import com.cm.systemcity.pojo.dtos.dict.DictDTO; -import com.cm.systemcity.pojo.vos.communityboss.CommunityBossExcelVO; import com.cm.systemcity.service.citybuilding.ICityBuildingService; import com.cm.systemcity.service.citydistrict.ICityDistrictService; import com.cm.systemcity.service.community.ICommunityService; import com.cm.systemcity.service.communityboss.ICommunityBossService; import com.cm.systemcity.service.dict.IDictService; -import com.cm.systemcity.util.ExcelUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; @@ -61,171 +54,12 @@ public class CommunityBossServiceImpl extends AbstractService implements ICommun @Autowired private ICityBuildingService cityBuildingService; - - @Autowired - private ExcelUtil excelUtil; private static final String CITY_DICT_ID = "9d179f05-3ea0-48f7-853c-d3b7124b791c"; - - /** - * 导入EXCEL - * @param excelVOList - * @return - * @throws Exception - */ - public SuccessResultData saveExcelCommunutyBoos(List excelVOList) throws Exception{ - List> errorList = new ArrayList<>(); - List usernameList = new ArrayList(); - for (CommunityBossExcelVO vo : excelVOList) { - if(StringUtils.isBlank(vo.getNowLevel().toString())){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"等级为空")); - excelVOList.remove(vo); - continue; - } - if(StringUtils.isBlank(vo.getAreaName())){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"办事处或街镇为空")); - excelVOList.remove(vo); - continue; - } - if(StringUtils.isBlank(vo.getNowUserName())){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"账号为空")); - excelVOList.remove(vo); - continue; - }else{ - usernameList.add(vo.getNowUserName()); - } - if(vo.getNowLevel() > 1){ - if(StringUtils.isBlank(vo.getCommunityName())){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"级别大于一级时所在社区不能为空")); - excelVOList.remove(vo); - continue; - } - if(StringUtils.isBlank(vo.getUpUserName())){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"级别大于一级时上级领导账号不能为空")); - excelVOList.remove(vo); - continue; - }else{ - usernameList.add(vo.getUpUserName()); - } - } - } - // 数据去重 - Set set = new HashSet(); - set.addAll(usernameList); - usernameList.clear(); - usernameList.addAll(set); - - List UserResourceBO = userService.listUserResourceByUsernames(usernameList); - - f1: - for (CommunityBossExcelVO vo : excelVOList) { - Map params = new HashMap<>(); - for (UserResourceBO userResourceBO : UserResourceBO) { - if (vo.getNowUserName().equals(userResourceBO.getUserUsername())){ - params.put("communityBossId",userResourceBO.getUserId()); - int count = communityBossDao.countCommunityBoss(params); - if (count > 0) { - errorList.add(excelUtil.setExportParams(vo.getNowName(),"该片长已存在")); - //片长以存在 - continue f1; - } - params.put("communityBossUsername",userResourceBO.getUserUsername()); - params.put("communityBossName",userResourceBO.getUserName()); - } - if (vo.getUpUserName().equals(userResourceBO.getUserUsername())){ - params.put("communityBossParentId",userResourceBO.getUserId()); - } - } - if(params.get("communityBossId") == null){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"人员信息不存在")); - continue; - } - DictDTO dictDTO = dictService.getDictByNameAndParentId(CITY_DICT_ID,vo.getAreaName()); - if(dictDTO == null){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"办事处或者街镇不存在")); - continue; - } - if(params.get("communityBossParentId") == null){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"领导信息不存在")); - continue; - } - params.put("areaId",dictDTO.getDictId()); - params.put("areaName",dictDTO.getDictName()); - params.put("communityBossLevel",vo.getNowLevel()); - setSaveInfo(params); - communityBossDao.saveCommunityBoss(params); - if (!StringUtils.isBlank(vo.getCommunityName())){ - LOG.debug("绑定片长和社区关系"); - String[] cns = vo.getCommunityName().split(","); - for (String cn : cns) { - Map p1 = new HashMap<>(); - p1.put("communityName",cn); - CommunityDTO cd = communityService.getCommunity(p1); - if (cd == null){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"社区不存在绑定社区失败")); - continue; - } - String[] communityIds = cd.getCommunityId().split(","); - String communityBossId = params.get("communityBossId").toString(); - saveCommunityBossCommunity(communityBossId, communityIds); - } - } - if (!StringUtils.isBlank(vo.getDistrictName())){ - LOG.debug("绑定片长和小区关系"); - String[] dns = vo.getDistrictName().split(","); - for (String dn : dns) { - CityDistrictDTO cdd = cityDistrictService.getCityDistrictByName(dn); - if(cdd == null){ - errorList.add(excelUtil.setExportParams(vo.getNowName(),"小区不存在绑定小区失败")); - continue; - } - String[] districtIds = cdd.getCityDistrictId().split(","); - String communityBossId = params.get("communityBossId").toString(); - saveCommunityBossDistrict(communityBossId, districtIds); - } - } - if (!StringUtils.isBlank(vo.getBuildingName())){ - LOG.debug("绑定片长和楼宇关系"); - String[] bns = vo.getBuildingName().split(","); - for (String bn : bns) { - CityBuildingDTO cbd = cityBuildingService.getCityBuildingByName(bn); - if (cbd == null) { - errorList.add(excelUtil.setExportParams(vo.getNowName(),"楼宇不存在绑定楼宇失败")); - continue; - } - String[] buildingIds = cbd.getBuildingName().split(","); - String communityBossId = params.get("communityBossId").toString(); - saveCommunityBossBuilding(communityBossId, buildingIds); - } - } - } - - String excelFileId = excelUtil.export(errorList); - - JSONObject json = new JSONObject(); - json.put("code","200"); - json.put("msg","导入成功"); - json.put("excelFileId",excelFileId); - return new SuccessResultData<>(json); - } - - - - - - - - - - @Override public SuccessResult saveCommunityBoss(Map params) throws SaveException, SearchException { Map communityBossParams = new HashMap<>(); communityBossParams.put("communityBossId", params.get("communityBossId").toString()); - int count = communityBossDao.countCommunityBoss(communityBossParams); - if (count > 0) { - throw new SearchException("该人员已是片长,请重新选择"); - } setSaveInfo(params); communityBossDao.saveCommunityBoss(params); LOG.debug("绑定片长和社区关系"); diff --git a/src/main/java/com/cm/systemcity/util/ExcelUtil.java b/src/main/java/com/cm/systemcity/util/ExcelUtil.java deleted file mode 100644 index 89eebb2..0000000 --- a/src/main/java/com/cm/systemcity/util/ExcelUtil.java +++ /dev/null @@ -1,248 +0,0 @@ -package com.cm.systemcity.util; - -import com.cm.common.plugin.service.file.IFileService; -import com.cm.common.utils.DateUtil; -import io.swagger.annotations.ApiModelProperty; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; -import org.apache.poi.ss.usermodel.*; -import org.apache.poi.xssf.usermodel.XSSFRow; -import org.apache.poi.xssf.usermodel.XSSFSheet; -import org.apache.poi.xssf.usermodel.XSSFWorkbook; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.web.multipart.MultipartFile; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryUsage; -import java.lang.reflect.Field; -import java.lang.reflect.Method; -import java.text.DecimalFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -/** - * EXCEL工具 - * @version 1.0 - * @author LY - * @date 2021/3/10 16:48 - */ - -@Component -public class ExcelUtil { - public static final String XLS = ".xls"; - public static final String XLSX = ".xlsx"; - - @Value("${file.uploadPath}") - private String uploadUrl; - - @Autowired - private IFileService fileService; - /** - * 导入EXCEL - * @param file - * @param clazz - * @param - * @return - * @throws IOException - */ - public List readExcelFileToDTO(MultipartFile file, Class clazz) throws IOException { - return readExcelFileToDTO(file, clazz, 0); - } - - public List readExcelFileToDTO(MultipartFile file, Class clazz, Integer sheetId) throws IOException { - //将文件转成workbook类型 - Workbook workbook = buildWorkbook(file); - //第一个表 - return readSheetToDTO(workbook.getSheetAt(sheetId), clazz); - } - - public List readSheetToDTO(Sheet sheet, Class clazz) throws IOException { - List result = new ArrayList<>(); - List> sheetValue = changeSheetToMapList(sheet); - for (Map valueMap : sheetValue) { - T dto = buildDTOByClass(clazz, valueMap); - if (dto != null) { - result.add(dto); - } - } - return result; - } - - //类型转换 - private Workbook buildWorkbook(MultipartFile file) throws IOException { - String filename = file.getOriginalFilename(); - if (filename.endsWith(XLS)) { - return new HSSFWorkbook(file.getInputStream()); - } else if (filename.endsWith(XLSX)) { - return new XSSFWorkbook(file.getInputStream()); - } else { - throw new IOException("unknown file format: " + filename); - } - } - - private List> changeSheetToMapList(Sheet sheet) { - List> result = new ArrayList<>(); - int rowNumber = sheet.getPhysicalNumberOfRows(); - String[] titles = getSheetRowValues(sheet.getRow(0)); // 第一行作为表头 - for (int i = 1; i < rowNumber; i++) { - String[] values = getSheetRowValues(sheet.getRow(i)); - Map valueMap = new HashMap<>(); - for (int j = 0; j < titles.length; j++) { - valueMap.put(titles[j], values[j]); - } - result.add(valueMap); - } - return result; - } - - private T buildDTOByClass(Class clazz, Map valueMap) { - try { - T dto = clazz.newInstance(); - for (Field field : clazz.getDeclaredFields()) { - ApiModelProperty desc = field.getAnnotation(ApiModelProperty.class); - String value = valueMap.get(desc.value()); - if (value != null) { - if(field.getType().getName().equalsIgnoreCase("java.lang.Integer")) { - Method method = clazz.getMethod(getSetMethodName(field.getName()), field.getType()); - //Integer i = Integer.parseInt(value.substring(0,value.indexOf("."))); - Integer i = Integer.parseInt(value); - method.invoke(dto, i); - }else{ - Method method = clazz.getMethod(getSetMethodName(field.getName()), field.getType()); - method.invoke(dto, value); - } - } - } - - return dto ; - } catch (Exception e) { - e.getStackTrace(); - } - return null; - } - - private String getSetMethodName(String name) { - String firstChar = name.substring(0, 1); - return "set" + firstChar.toUpperCase() + name.substring(1); - } - - private String[] getSheetRowValues(Row row) { - if (row == null) { - return new String[]{}; - } else { - int cellNumber = row.getLastCellNum(); - List cellValueList = new ArrayList<>(); - for (int i = 0; i < cellNumber; i++) { - cellValueList.add(getValueOnCell(row.getCell(i))); - } - return cellValueList.toArray(new String[0]); - } - } - - private String getValueOnCell(Cell cell) { - if (cell == null) { - return ""; - } - switch (cell.getCellTypeEnum()) { - case STRING: return cell.getStringCellValue(); - //case NUMERIC: return String.format("%.2f", cell.getNumericCellValue()); - case NUMERIC: - DecimalFormat df = new DecimalFormat("0"); - return String.valueOf(df.format(cell.getNumericCellValue())); - case BOOLEAN: return cell.getBooleanCellValue() ? "true" : "false"; - case FORMULA: - try { - return cell.getStringCellValue(); - } catch (Exception e) { -// return String.format("%.2f", cell.getNumericCellValue()); - return String.valueOf(cell.getNumericCellValue()); - } - case BLANK: - return ""; - default: return ""; - } - } - - - - public String export(List> data) throws Exception{ - String[] title = {"姓名", "原因"}; - // 创建工作薄 - XSSFWorkbook workbook = new XSSFWorkbook(); - // 创建工作表 - XSSFSheet sheet = workbook.createSheet("sheet1"); - XSSFRow sheetRow = sheet.createRow(0); - - for (int i = 0; i < data.size(); i++) { - sheetRow = sheet.createRow(i+1); - sheetRow.createCell(0).setCellValue( data.get(i).get("name").toString()); - sheetRow.createCell(1).setCellValue( data.get(i).get("option").toString()); - } - String filePath = uploadUrl; - - String fileName = DateUtil.getSdfTimes()+".xls"; - File file = new File(filePath+"\\"+fileName); - Map fileIdMap = new HashMap<>(); - fileService.saveUploadErrorExcelFileInfo(fileName,filePath,file.length(),fileIdMap); - OutputStream out = new FileOutputStream(file); - workbook.write(out); - workbook.close(); - out.close(); - return fileIdMap.get("fileId").toString(); - } - - - public Map setExportParams(String name,String option){ - Map params = new HashMap<>(); - params.put("name",name); - params.put("option",option); - return params; - } - - - - - - - - - - - public static void main(String[] args) { - String[] data = {"73982", "1", "NH", "1", "2018122510", "2", "0", "0", "0", "12233", "0", "楼层组件优化", "0"}; - - MemoryUsage startMemory = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage(); - - // 创建工作薄 - XSSFWorkbook workbook = new XSSFWorkbook(); - // 创建工作表 - XSSFSheet sheet = workbook.createSheet("sheet1"); - - //设置数据 - for (int row = 0; row < 3; row++) { - XSSFRow sheetRow = sheet.createRow(row); - for (int column = 0; column < data.length; column++) { - sheetRow.createCell(column).setCellValue(data[column]); - } - } - - - //写入文件 - try { - workbook.write(new FileOutputStream(new File("111"))); - workbook.close(); - } catch (Exception ex) { - System.out.println(ex.getMessage()); - } - - - } -} - diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 904e34c..5831c6b 100755 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -24,7 +24,7 @@ spring: max-request-size: 1GB datasource: druid: - url: jdbc:mysql://49.233.36.36:6688/db_cloud?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false + url: jdbc:mysql://49.233.36.36:6688/db_cloud_city?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&autoReconnect=true&failOverReadOnly=false&useSSL=false db-type: mysql driver-class-name: com.mysql.jdbc.Driver username: wanggeng diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties deleted file mode 100644 index 8b13789..0000000 --- a/src/main/resources/application.properties +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml index 798c247..221f47a 100755 --- a/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml +++ b/src/main/resources/mybatis/mapper/communityboss/communityboss-mapper.xml @@ -2,7 +2,7 @@ - + @@ -59,12 +59,11 @@ INSERT INTO city_community_boss( community_boss_id, - community_boss_username, - community_boss_name, community_boss_parent_id, community_boss_level, area_id, area_name, + grid_summary, creator, gmt_create, modifier, @@ -72,12 +71,11 @@ is_delete ) VALUES( #{communityBossId}, - #{communityBossUsername}, - #{communityBossName}, #{communityBossParentId}, #{communityBossLevel}, #{areaId}, #{areaName}, + #{gridSummary}, #{creator}, #{gmtCreate}, #{modifier}, @@ -123,6 +121,9 @@ area_name = #{areaName}, + + + grid_summary = #{gridSummary}, modifier = #{modifier}, gmt_modified = #{gmtModified} @@ -134,28 +135,13 @@ SELECT t1.community_boss_id, - t1.community_boss_name, - t1.community_boss_username, t1.community_boss_level, t1.area_id, t1.area_name, - t2.community_boss_id community_boss_parent_id, - t2.community_boss_name community_boss_parent_name, - t3.user_phone community_boss_phone + t1.community_boss_parent_id + t1.grid_summary FROM city_community_boss t1 - LEFT JOIN - city_community_boss t2 - ON - t1.community_boss_parent_id = t2.community_boss_id - AND - t2.is_delete = 0 - INNER JOIN - sys_user t3 - ON - t1.community_boss_id = t3.user_id - AND - t3.is_delete = 0 WHERE t1.is_delete = 0 @@ -295,24 +266,14 @@ @@ -350,37 +309,24 @@ FROM ( SELECT t1.community_boss_id, - t1.community_boss_name, - t1.community_boss_username, + t1.community_boss_parent_id, t1.community_boss_level, t1.area_id, t1.area_name, - t2.community_boss_id community_boss_parent_id, - t2.community_boss_name community_boss_parent_name, - t3.user_phone community_boss_phone, - GROUP_CONCAT(t5.community_id) community_ids, - GROUP_CONCAT(t5.community_name) community_names + GROUP_CONCAT(t3.community_id) community_ids, + GROUP_CONCAT(t3.community_name) community_names FROM city_community_boss t1 - LEFT JOIN city_community_boss t2 ON t1.community_boss_parent_id = t2.community_boss_id - AND t2.is_delete = 0 - INNER JOIN sys_user t3 ON t1.community_boss_id = t3.user_id - AND t3.is_delete = 0 - LEFT JOIN city_community_boss_community t4 ON t1.community_boss_id = t4.community_boss_id - LEFT JOIN city_community t5 ON t4.community_id = t5.community_id - AND t5.is_delete = 0 + LEFT JOIN city_community_boss_community t2 ON t1.community_boss_id = t2.community_boss_id + LEFT JOIN city_community t3 ON t2.community_id = t3.community_id AND t3.is_delete = 0 WHERE t1.is_delete = 0 GROUP BY t1.community_boss_id, - t1.community_boss_name, - t1.community_boss_username, + t1.community_boss_parent_id, t1.community_boss_level, t1.area_id, - t1.area_name, - t2.community_boss_id, - t2.community_boss_name, - t3.user_phone + t1.area_name ) mt1 WHERE 1 = 1 @@ -433,7 +379,6 @@ t1.area_id, t1.area_name, t1.community_boss_id, - t1.community_boss_name FROM city_community_boss t1 WHERE @@ -443,8 +388,6 @@ - - INSERT INTO city_community_boss_district( diff --git a/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java b/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java index 1b57d76..fa20fac 100644 --- a/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java +++ b/src/test/java/com/cm/systemcity/SystemCityApplicationTests.java @@ -1,6 +1,6 @@ package com.cm.systemcity; -import org.junit.jupiter.api.Test; +import org.junit.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest