Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into release_temp

dev_shibei_match
jianjun 4 years ago
parent
commit
a1a5d90d72
  1. 2
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java
  2. 14
      epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java
  3. 2
      epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java
  4. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java
  5. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  6. 276
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java
  7. 31
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java
  8. 230
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java
  9. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  10. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java
  11. 8
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java
  12. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java
  13. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java
  14. 13
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java
  15. 4
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java
  16. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java
  17. 14
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java
  18. 2
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java
  19. 19
      epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java
  20. 46
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java
  21. 6
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java
  22. 5
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java
  23. 69
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java
  24. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java
  25. 7
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java
  26. 31
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java
  27. 61
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java
  28. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java
  29. 20
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java
  30. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java
  31. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java
  32. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java
  33. 9
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java
  34. 150
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java
  35. 13
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java
  36. 40
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java
  37. 131
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java
  38. 10
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java
  39. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml
  40. 14
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml
  41. 29
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml
  42. 19
      epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml
  43. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java
  44. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java
  45. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java
  46. 6
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java
  47. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java
  48. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java
  49. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java
  50. 5
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java
  51. 2
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java
  52. 3
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java
  53. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java
  54. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java
  55. 1
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java
  56. 19
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java
  57. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java
  58. 28
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java
  59. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml
  60. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml
  61. 3
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml
  62. 6
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java
  63. 3
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleService.java
  64. 16
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java
  65. 26
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java
  66. 7
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  67. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  68. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java
  69. 7
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  70. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java
  71. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
  72. 6
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java
  73. 9
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java
  74. 23
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java
  75. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
  76. 26
      epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml
  77. 13
      epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

2
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/EpmetAdminOpenFeignClient.java

@ -82,6 +82,6 @@ public interface EpmetAdminOpenFeignClient {
* @Author zhaoqifeng * @Author zhaoqifeng
* @Date 2021/11/19 17:36 * @Date 2021/11/19 17:36
*/ */
@PostMapping("/sys/dict/data/dictMap/{dictType}") @PostMapping("/sys/dict/data/dictmap/{dictType}")
Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType); Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType);
} }

14
epmet-admin/epmet-admin-client/src/main/java/com/epmet/feign/fallback/EpmetAdminOpenFeignClientFallback.java

@ -14,36 +14,36 @@ import java.util.Map;
public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignClient { public class EpmetAdminOpenFeignClientFallback implements EpmetAdminOpenFeignClient {
@Override @Override
public Result<List<CorsConfigResultDTO>> list() { public Result<List<CorsConfigResultDTO>> list() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "list", null); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "list", null);
} }
@Override @Override
public Result<List<OptionResultDTO>> getEducationOption() { public Result<List<OptionResultDTO>> getEducationOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getEducationOption", null); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getEducationOption", null);
} }
@Override @Override
public Result<List<OptionResultDTO>> getHouseOption() { public Result<List<OptionResultDTO>> getHouseOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHouseOption", null); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getHouseOption", null);
} }
@Override @Override
public Result<List<OptionResultDTO>> getNationOption() { public Result<List<OptionResultDTO>> getNationOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNationOption", null); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getNationOption", null);
} }
@Override @Override
public Result<List<OptionResultDTO>> getNineSmallPlacesOption() { public Result<List<OptionResultDTO>> getNineSmallPlacesOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getNineSmallPlacesOption", null); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getNineSmallPlacesOption", null);
} }
@Override @Override
public Result<List<OptionResultDTO>> getRelationshipOption() { public Result<List<OptionResultDTO>> getRelationshipOption() {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getRelationshipOption", null); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "getRelationshipOption", null);
} }
@Override @Override
public Result<Map<String, String>> dictMap(String dictType) { public Result<Map<String, String>> dictMap(String dictType) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "dictMap", dictType); return ModuleUtils.feignConError(ServiceConstant.EPMET_ADMIN_SERVER, "dictMap", dictType);
} }
} }

2
epmet-admin/epmet-admin-server/src/main/java/com/epmet/controller/SysDictDataController.java

@ -157,7 +157,7 @@ public class SysDictDataController {
* @Author zhaoqifeng * @Author zhaoqifeng
* @Date 2021/11/19 17:36 * @Date 2021/11/19 17:36
*/ */
@PostMapping("dictMap/{dictType}") @PostMapping("dictmap/{dictType}")
public Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType) { public Result<Map<String, String>> dictMap(@PathVariable("dictType") String dictType) {
return new Result<Map<String, String>>().ok(sysDictDataService.dictMap(dictType)); return new Result<Map<String, String>>().ok(sysDictDataService.dictMap(dictType));
} }

1
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/OptionResultDTO.java

@ -15,6 +15,7 @@ public class OptionResultDTO implements Serializable {
private static final long serialVersionUID = 8618231166600518980L; private static final long serialVersionUID = 8618231166600518980L;
private String label; private String label;
private String value; private String value;
private String pValue;
private String sysDictDataId; private String sysDictDataId;
private List<OptionResultDTO> children; private List<OptionResultDTO> children;
} }

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -155,6 +155,10 @@ public enum EpmetErrorCode {
APPOINTMENT_ERROR(8528, "%s尚有未履行的预约存在,请确认后操作"), APPOINTMENT_ERROR(8528, "%s尚有未履行的预约存在,请确认后操作"),
EXISTS_SAME_PHONE_ERROR(8529, "%s存在重复"),
COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR(8530, "%s社区自组织名称已存在"),
// 该错误不会提示给前端,只是后端传输错误信息用。 // 该错误不会提示给前端,只是后端传输错误信息用。
ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"), ACCESS_SQL_FILTER_MISSION_ARGS(8701, "缺少生成权限过滤SQL所需参数"),
OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"), OPER_ADD_CUSTOMER_ROOT_AGENCY_ERROR(8702, "添加客户根级组织失败"),

276
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelPoiUtils.java

@ -0,0 +1,276 @@
package com.epmet.commons.tools.utils;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.List;
import java.util.Map;
import java.util.NoSuchElementException;
public class ExcelPoiUtils {
/**
* excel 导出
*
* @param list 数据列表
* @param fileName 导出时的excel名称
* @param response
*/
public static void exportExcel(List<Map<String, Object>> list, String fileName, HttpServletResponse response) throws IOException {
defaultExport(list, fileName, response);
}
/**
* 默认的 excel 导出
*
* @param list 数据列表
* @param fileName 导出时的excel名称
* @param response
*/
private static void defaultExport(List<Map<String, Object>> list, String fileName, HttpServletResponse response) throws IOException {
//把数据添加到excel表格中
Workbook workbook = ExcelExportUtil.exportExcel(list, ExcelType.HSSF);
downLoadExcel(fileName, response, workbook);
}
/**
* excel 导出
*
* @param list 数据列表
* @param pojoClass pojo类型
* @param fileName 导出时的excel名称
* @param response
* @param exportParams 导出参数标题sheet名称是否创建表头表格类型
*/
private static void defaultExport(List<?> list, Class<?> pojoClass, String fileName, HttpServletResponse response, ExportParams exportParams) throws IOException {
//把数据添加到excel表格中
Workbook workbook = ExcelExportUtil.exportExcel(exportParams, pojoClass, list);
downLoadExcel(fileName, response, workbook);
}
/**
* excel 导出
*
* @param list 数据列表
* @param pojoClass pojo类型
* @param fileName 导出时的excel名称
* @param exportParams 导出参数标题sheet名称是否创建表头表格类型
* @param response
*/
public static void exportExcel(List<?> list, Class<?> pojoClass, String fileName, ExportParams exportParams, HttpServletResponse response) throws IOException {
defaultExport(list, pojoClass, fileName, response, exportParams);
}
/**
* excel 导出
*
* @param list 数据列表
* @param title 表格内数据标题
* @param sheetName sheet名称
* @param pojoClass pojo类型
* @param fileName 导出时的excel名称
* @param response
*/
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName, HttpServletResponse response) throws IOException {
defaultExport(list, pojoClass, fileName, response, new ExportParams(title, sheetName, ExcelType.XSSF));
}
/**
* excel 导出
*
* @param list 数据列表
* @param title 表格内数据标题
* @param sheetName sheet名称
* @param pojoClass pojo类型
* @param fileName 导出时的excel名称
* @param isCreateHeader 是否创建表头
* @param response
*/
public static void exportExcel(List<?> list, String title, String sheetName, Class<?> pojoClass, String fileName, boolean isCreateHeader, HttpServletResponse response) throws IOException {
ExportParams exportParams = new ExportParams(title, sheetName, ExcelType.XSSF);
exportParams.setCreateHeadRows(isCreateHeader);
defaultExport(list, pojoClass, fileName, response, exportParams);
}
/**
* 根据模板生成excel后导出
* @param templatePath 模板路径
* @param map 数据集合
* @param fileName 文件名
* @param response
* @throws IOException
*/
public static void exportExcel(TemplateExportParams templatePath, Map<String, Object> map, String fileName, HttpServletResponse response) throws IOException {
Workbook workbook = ExcelExportUtil.exportExcel(templatePath, map);
downLoadExcel(fileName, response, workbook);
}
/**
* excel下载
*
* @param fileName 下载时的文件名称
* @param response
* @param workbook excel数据
*/
private static void downLoadExcel(String fileName, HttpServletResponse response, Workbook workbook) throws IOException {
try {
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName + ".xlsx", "UTF-8"));
workbook.write(response.getOutputStream());
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
/**
* excel 导入
*
* @param file excel文件
* @param pojoClass pojo类型
* @param <T>
* @return
*/
public static <T> List<T> importExcel(MultipartFile file, Class<T> pojoClass) throws IOException {
return importExcel(file, 1, 1, pojoClass);
}
/**
* excel 导入
*
* @param filePath excel文件路径
* @param titleRows 表格内数据标题行
* @param headerRows 表头行
* @param pojoClass pojo类型
* @param <T>
* @return
*/
public static <T> List<T> importExcel(String filePath, Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
if (StringUtils.isBlank(filePath)) {
return null;
}
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);
params.setHeadRows(headerRows);
params.setNeedSave(true);
params.setSaveUrl("/tmp/excel/");
try {
return ExcelImportUtil.importExcel(new File(filePath), pojoClass, params);
} catch (NoSuchElementException e) {
throw new IOException("模板不能为空");
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
/**
* excel 导入
*
* @param file 上传的文件
* @param titleRows 表格内数据标题行
* @param headerRows 表头行
* @param pojoClass pojo类型
* @param <T>
* @return
*/
public static <T> List<T> importExcel(MultipartFile file, Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
if (file == null) {
return null;
}
try {
return importExcel(file.getInputStream(), titleRows, headerRows, pojoClass);
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
/**
* excel 导入
*
* @param inputStream 文件输入流
* @param titleRows 表格内数据标题行
* @param headerRows 表头行
* @param pojoClass pojo类型
* @param <T>
* @return
*/
public static <T> List<T> importExcel(InputStream inputStream, Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
if (inputStream == null) {
return null;
}
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);
params.setHeadRows(headerRows);
params.setSaveUrl("/tmp/excel/");
params.setNeedSave(true);
try {
return ExcelImportUtil.importExcel(inputStream, pojoClass, params);
} catch (NoSuchElementException e) {
throw new IOException("excel文件不能为空");
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
/**
* excel 导入有错误信息
*
* @param file 上传的文件
* @param pojoClass pojo类型
* @param <T>
* @return
*/
public static <T> ExcelImportResult<T> importExcelMore(MultipartFile file,Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
if (file == null) {
return null;
}
try {
return importExcelMore(file.getInputStream(), titleRows, headerRows, pojoClass);
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
/**
* excel 导入
*
* @param inputStream 文件输入流
* @param pojoClass pojo类型
* @param <T>
* @return
*/
private static <T> ExcelImportResult<T> importExcelMore(InputStream inputStream,Integer titleRows, Integer headerRows, Class<T> pojoClass) throws IOException {
if (inputStream == null) {
return null;
}
ImportParams params = new ImportParams();
params.setTitleRows(titleRows);//表格内数据标题行
params.setHeadRows(headerRows);//表头行
params.setSaveUrl("/tmp/excel/");
params.setNeedSave(true);
params.setNeedVerify(true);
try {
return ExcelImportUtil.importExcelMore(inputStream, pojoClass, params);
} catch (NoSuchElementException e) {
throw new IOException("excel文件不能为空");
} catch (Exception e) {
throw new IOException(e.getMessage());
}
}
}

31
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/ExcelVerifyInfo.java

@ -0,0 +1,31 @@
package com.epmet.commons.tools.utils;
import cn.afterturn.easypoi.handler.inter.IExcelDataModel;
import cn.afterturn.easypoi.handler.inter.IExcelModel;
public class ExcelVerifyInfo implements IExcelModel, IExcelDataModel {
private String errorMsg;
private int rowNum;
@Override
public Integer getRowNum() {
return rowNum;
}
@Override
public void setRowNum(Integer rowNum) {
this.rowNum = rowNum;
}
@Override
public String getErrorMsg() {
return errorMsg;
}
@Override
public void setErrorMsg(String errorMsg) {
this.errorMsg = errorMsg;
}
}

230
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java

@ -177,143 +177,155 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
threadPool.submit(() -> { threadPool.submit(() -> {
//党员基本情况screen_cpc_base_data //党员基本情况screen_cpc_base_data
try { try {
partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId, dateId);
} catch (Exception e) {
log.error("党员基本情况抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
//先锋模范screen_pioneer_data
if (isLast) {
try { try {
pioneerDataExtractService.extractGridPioneerData(customerId, dateId); partyBaseInfoService.statsPartyMemberBaseInfoToScreen(customerId, dateId);
} catch (Exception e) { } catch (Exception e) {
log.error("先锋模范【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("党员基本情况抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
} }
try { //先锋模范screen_pioneer_data
pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId); if (isLast) {
} catch (Exception e) { try {
log.error("先锋模范【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); pioneerDataExtractService.extractGridPioneerData(customerId, dateId);
} } catch (Exception e) {
try { log.error("先锋模范【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId); }
} catch (Exception e) { try {
log.error("先锋模范【extractExceptCommunityPioneerData】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); pioneerDataExtractService.extractCommunityPioneerData(customerId, dateId);
} catch (Exception e) {
log.error("先锋模范【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
try {
pioneerDataExtractService.extractExceptCommunityPioneerData(customerId, dateId);
} catch (Exception e) {
log.error("先锋模范【extractExceptCommunityPioneerData】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
} }
} finally {
latch.countDown();
log.info("extractDaily 1 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
} }
latch.countDown();
log.info("extractDaily 1 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
}); });
threadPool.submit(() -> { threadPool.submit(() -> {
//公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data //公众参与排行(注册人数、参与人数、话题数、议题数、项目数)screen_public_party_total_data
try { try {
publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId, dateId);
} catch (Exception e) {
log.error("公众参与排行抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
if (isLast) {
//基层治理- 难点赌点 screen_difficulty_data | screen_difficulty_img_data
try { try {
ScreenCentralZoneDataFormDTO param2 = new ScreenCentralZoneDataFormDTO(); publicPartiTotalDataExtractService.extractPublicPartiTotalData(customerId, dateId);
param2.setCustomerId(customerId);
param2.setDateId(null);
log.info("【难点赌点数据上报开始------】 当前客户Id{}", param2.getCustomerId());
//screenGrassrootsGovernDataAbsorptionService.difficultyDataHub(param);
screenGrassrootsGovernDataAbsorptionService.difficultyDataExtract(param2);
log.info("【难点赌点数据上报结束------】 当前客户Id{}", param2.getCustomerId());
} catch (Exception e) { } catch (Exception e) {
log.error("基层治理-难点赌点抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("公众参与排行抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
if (isLast) {
//基层治理- 难点赌点 screen_difficulty_data | screen_difficulty_img_data
try {
ScreenCentralZoneDataFormDTO param2 = new ScreenCentralZoneDataFormDTO();
param2.setCustomerId(customerId);
param2.setDateId(null);
log.info("【难点赌点数据上报开始------】 当前客户Id{}", param2.getCustomerId());
//screenGrassrootsGovernDataAbsorptionService.difficultyDataHub(param);
screenGrassrootsGovernDataAbsorptionService.difficultyDataExtract(param2);
log.info("【难点赌点数据上报结束------】 当前客户Id{}", param2.getCustomerId());
} catch (Exception e) {
log.error("基层治理-难点赌点抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
} }
} finally {
latch.countDown();
log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
} }
latch.countDown();
log.info("extractDaily 2 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
}); });
threadPool.submit(() -> { threadPool.submit(() -> {
ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO();
param.setCustomerId(customerId);
param.setDateId(dateId);
//中央区 screen_user_total_data
try { try {
screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); ScreenCentralZoneDataFormDTO param = new ScreenCentralZoneDataFormDTO();
} catch (Exception e) { param.setCustomerId(customerId);
log.error("中央区抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); param.setDateId(dateId);
} //中央区 screen_user_total_data
try {
screenCentralZoneDataAbsorptionService.centralZoneDataHub(param);
} catch (Exception e) {
log.error("中央区抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
try { try {
// 项目(事件)分析按网格_按天统计 // 项目(事件)分析按网格_按天统计
screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId); screenProjectGridDailyService.extractionProjectGridDaily(customerId, dateId);
} catch (Exception e) { } catch (Exception e) {
log.error("项目(事件)分析按网格_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("项目(事件)分析按网格_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e);
} }
try { try {
// 项目(事件)分析按组织_按天统计 // 项目(事件)分析按组织_按天统计
screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId); screenProjectOrgDailyService.extractionProjectOrgDaily(customerId, dateId);
} catch (Exception e) { } catch (Exception e) {
log.error("项目(事件)分析按组织_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("项目(事件)分析按组织_按天统计失败,customerId为:" + customerId + "dateId为:" + dateId, e);
} }
//按天统计:网格内各个分类下的项目总数 //按天统计:网格内各个分类下的项目总数
try { try {
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId, dateId); screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectGridData(customerId, dateId);
} catch (Exception e) { } catch (Exception e) {
log.error("按天统计:网格内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("按天统计:网格内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e);
} }
// 按天统计:组织内各个分类下的项目总数 // 按天统计:组织内各个分类下的项目总数
try { try {
screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId, dateId); screenProjectCategoryGridAndOrgDailyService.extractCategoryProjectOrgData(customerId, dateId);
} catch (Exception e) { } catch (Exception e) {
log.error("按天统计:组织内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("按天统计:组织内各个分类下的项目总数,customerId为:" + customerId + "dateId为:" + dateId, e);
}
} finally {
latch.countDown();
log.info("extractDaily 3 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
} }
latch.countDown();
log.info("extractDaily 3 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
}); });
threadPool.submit(() -> { threadPool.submit(() -> {
//治理能力排行screen_govern_rank_data //治理能力排行screen_govern_rank_data
try { try {
governRankDataExtractService.extractGridDataDaily(customerId, dateId); try {
} catch (Exception e) { governRankDataExtractService.extractGridDataDaily(customerId, dateId);
log.error("治理能力排行【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); } catch (Exception e) {
} log.error("治理能力排行【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
try { }
governRankDataExtractService.extractCommunityDataDaily(customerId, dateId); try {
} catch (Exception e) { governRankDataExtractService.extractCommunityDataDaily(customerId, dateId);
log.error("治理能力排行【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); } catch (Exception e) {
} log.error("治理能力排行【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
try { }
governRankDataExtractService.extractStreetDataDaily(customerId, dateId); try {
} catch (Exception e) { governRankDataExtractService.extractStreetDataDaily(customerId, dateId);
log.error("治理能力排行【街道】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); } catch (Exception e) {
} log.error("治理能力排行【街道】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
try { }
governRankDataExtractService.extractDistrictDataDaily(customerId, dateId); try {
} catch (Exception e) { governRankDataExtractService.extractDistrictDataDaily(customerId, dateId);
log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); } catch (Exception e) {
} log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
try { try {
ExtractFactGridGovernDailyFromDTO extractFactGridGovernDailyFromDTO = new ExtractFactGridGovernDailyFromDTO(); ExtractFactGridGovernDailyFromDTO extractFactGridGovernDailyFromDTO = new ExtractFactGridGovernDailyFromDTO();
extractFactGridGovernDailyFromDTO.setCustomerId(customerId); extractFactGridGovernDailyFromDTO.setCustomerId(customerId);
extractFactGridGovernDailyFromDTO.setDateId(dateId); extractFactGridGovernDailyFromDTO.setDateId(dateId);
factGridGovernDailyService.extractFactGridGovernDaily(extractFactGridGovernDailyFromDTO); factGridGovernDailyService.extractFactGridGovernDaily(extractFactGridGovernDailyFromDTO);
} catch (Exception e) { } catch (Exception e) {
log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e);
} }
try { try {
factAgencyGovernDailyService.extractFactAgencyGovernDaily(customerId, dateId); factAgencyGovernDailyService.extractFactAgencyGovernDaily(customerId, dateId);
} catch (Exception e) { } catch (Exception e) {
log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e);
} }
try { try {
factGridMemberStatisticsDailyService.extractGridMemberStatisticsDaily(customerId, dateId); factGridMemberStatisticsDailyService.extractGridMemberStatisticsDaily(customerId, dateId);
} catch (Exception e) { } catch (Exception e) {
log.error("网格员数据统计fact_grid_member_statistics_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); log.error("网格员数据统计fact_grid_member_statistics_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e);
}
extractPartData(customerId, dateId);
} finally {
latch.countDown();
log.info("extractDaily 4 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
} }
extractPartData(customerId, dateId);
latch.countDown();
log.info("extractDaily 4 thread run end ========= dateId:{},customerId:{}", dateId, customerId);
}); });
try { try {
latch.await(); latch.await();
@ -346,7 +358,7 @@ public class ScreenExtractServiceImpl implements ScreenExtractService {
//dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。 //dateId不为空,只计算当天存在评价记录的项目,更新项目对应的得分。
screenProjectSettleService.updateProjectSatisfactionScore(customerId,dateId,null); screenProjectSettleService.updateProjectSatisfactionScore(customerId,dateId,null);
}catch(Exception e){ }catch(Exception e){
log.error("群众不满得分更新失败"); log.error("群众不满得分更新失败,msg:{}", e);
} }
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java

@ -352,7 +352,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
entity.setProjectId(project.getProjectId()); entity.setProjectId(project.getProjectId());
entity.setOriginCategoryCode(category); entity.setOriginCategoryCode(category);
CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(customerId, category); CustomerProjectCategoryDictEntity categoryEntity = customerProjectCategoryDictService.getByCategoryCode(customerId, category);
if (null != categoryEntity) { if (null == categoryEntity) {
log.error("customerId:{} categoryCode:{} is not exist in ProjectCategoryDict", customerId, category); log.error("customerId:{} categoryCode:{} is not exist in ProjectCategoryDict", customerId, category);
return; return;
} }

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java

@ -60,7 +60,7 @@ public class BaseReportServiceImpl implements BaseReportService {
} }
if (!CollectionUtils.isEmpty(formDTO.getDataList())) { if (!CollectionUtils.isEmpty(formDTO.getDataList())) {
ListUtils.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED) ListUtils.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED)
.forEach(part->baseReportDao.insertBatchAgencyRegUser(part); .forEach(part->baseReportDao.insertBatchAgencyRegUser(part));
} }
} }

8
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/IcPartyUnitDTO.java

@ -17,8 +17,10 @@
package com.epmet.dto; package com.epmet.dto;
import com.epmet.commons.tools.validator.group.AddGroup;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -58,11 +60,13 @@ public class IcPartyUnitDTO implements Serializable {
/** /**
* 单位名称 * 单位名称
*/ */
@NotBlank(message = "单位名称不能为空",groups = AddGroup.class)
private String unitName; private String unitName;
/** /**
* 分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他 * 分类 楼宇党建 两新组织 区域单位党建 机关直属部门 其他
*/ */
@NotBlank(message = "分类不能为空",groups = AddGroup.class)
private String type; private String type;
/** /**
@ -75,11 +79,13 @@ public class IcPartyUnitDTO implements Serializable {
/** /**
* 联系人 * 联系人
*/ */
@NotBlank(message = "联系人不能为空",groups = AddGroup.class)
private String contact; private String contact;
/** /**
* 联系电话 * 联系电话
*/ */
@NotBlank(message = "联系电话不能为空",groups = AddGroup.class)
private String contactMobile; private String contactMobile;
/** /**
@ -95,11 +101,13 @@ public class IcPartyUnitDTO implements Serializable {
/** /**
* 中心位置经度 * 中心位置经度
*/ */
@NotBlank(message = "经度不能为空",groups = AddGroup.class)
private String longitude; private String longitude;
/** /**
* 中心位置纬度 * 中心位置纬度
*/ */
@NotBlank(message = "纬度不能为空",groups = AddGroup.class)
private String latitude; private String latitude;
/** /**

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/AddCommunitySelfOrganizationFormDTO.java

@ -54,18 +54,16 @@ public class AddCommunitySelfOrganizationFormDTO implements Serializable {
/** /**
* 社区自组织创建时间 * 社区自组织创建时间
*/ */
private Date organizationCreatedTime; private String organizationCreatedTime;
/** /**
* 经度 * 经度
*/ */
@NotBlank(message = "longitude不能为空",groups = AddCommunitySelfOrganizationForm.class)
private String longitude; private String longitude;
/** /**
* 纬度 * 纬度
*/ */
@NotBlank(message = "latitude不能为空",groups = AddCommunitySelfOrganizationForm.class)
private String latitude; private String latitude;
/** /**

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/EditCommunitySelfOrganizationFormDTO.java

@ -61,13 +61,11 @@ public class EditCommunitySelfOrganizationFormDTO implements Serializable {
/** /**
* 经度 * 经度
*/ */
@NotBlank(message = "longitude不能为空",groups = EditCommunitySelfOrganizationForm.class)
private String longitude; private String longitude;
/** /**
* 纬度 * 纬度
*/ */
@NotBlank(message = "latitude不能为空",groups = EditCommunitySelfOrganizationForm.class)
private String latitude; private String latitude;
/** /**

13
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/GetListSocietyOrgFormDTO.java

@ -21,7 +21,6 @@ import lombok.Data;
import javax.validation.constraints.Min; import javax.validation.constraints.Min;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
/** /**
@ -39,15 +38,21 @@ public class GetListSocietyOrgFormDTO implements Serializable {
//负责人电话 //负责人电话
private String mobile; private String mobile;
//起始服务时间 //起始服务时间
private Date serviceStartTime; private String serviceStartTime;
//终止服务时间 //终止服务时间
private Date serviceEndTime; private String serviceEndTime;
//页码 //页码
@Min(1) @Min(1)
private Integer pageNo; private Integer pageNo = 1;
//每页多少条 //每页多少条
private Integer pageSize = 20; private Integer pageSize = 20;
//是否分页(是:true 否:false)
private Boolean isPage = true;
//token中客户Id //token中客户Id
private String customerId; private String customerId;
//token中userId
private String staffId;
//token中userId所属组织的pid
private String pids;
} }

4
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/FinishStaffFromDTO.java

@ -21,8 +21,8 @@ public class FinishStaffFromDTO implements Serializable {
@NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class) @NotBlank(message = "需求id不能为空", groups = AddUserInternalGroup.class)
private String demandRecId; private String demandRecId;
@NotBlank(message = "服务不能为空", groups = AddUserShowGroup.class) @NotBlank(message = "服务id不能为空", groups = AddUserShowGroup.class)
private String serverId; private String serviceId;
@NotNull(message = "实际服务开始不能为空", groups = AddUserShowGroup.class) @NotNull(message = "实际服务开始不能为空", groups = AddUserShowGroup.class)
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/ServiceQueryFormDTO.java

@ -39,6 +39,4 @@ public class ServiceQueryFormDTO implements Serializable {
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId; private String customerId;
private String demandRecId;
} }

14
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/form/demand/UserDemandPageFormDTO.java

@ -2,10 +2,8 @@ package com.epmet.dto.form.demand;
import com.epmet.commons.tools.dto.form.PageFormDTO; import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date;
@Data @Data
public class UserDemandPageFormDTO extends PageFormDTO implements Serializable { public class UserDemandPageFormDTO extends PageFormDTO implements Serializable {
@ -42,14 +40,12 @@ public class UserDemandPageFormDTO extends PageFormDTO implements Serializable {
/** /**
* 上报时间开始 * 上报时间开始
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd") private String reportStartTime;
private Date reportStartDate;
/** /**
* 上报时间截止 * 上报时间截止
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd") private String reportEndTime;
private Date reportEndDate;
/** /**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished * 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
@ -72,12 +68,10 @@ public class UserDemandPageFormDTO extends PageFormDTO implements Serializable {
/** /**
* 希望服务时间开始 * 希望服务时间开始
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd") private String wantServiceStartTime;
private Date wantServiceStartDate;
/** /**
* 希望截止 * 希望截止
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd") private String wantServiceEndTime;
private Date wantServiceEndDate;
} }

2
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/SocietyOrgListResultDTO.java

@ -31,6 +31,8 @@ public class SocietyOrgListResultDTO implements Serializable {
//所属组织Id //所属组织Id
private String agencyId; private String agencyId;
//所属组织名称
private String agencyName;
//社会组织Id //社会组织Id
private String societyId; private String societyId;
//社会组织名称 //社会组织名称

19
epmet-module/epmet-heart/epmet-heart-client/src/main/java/com/epmet/dto/result/demand/DemandRecResultDTO.java

@ -1,7 +1,6 @@
package com.epmet.dto.result.demand; package com.epmet.dto.result.demand;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
@ -14,12 +13,14 @@ public class DemandRecResultDTO implements Serializable {
private static final long serialVersionUID = 1140730681599839420L; private static final long serialVersionUID = 1140730681599839420L;
private String demandRecId; private String demandRecId;
@JsonIgnore //@JsonIgnore
private String gridId; private String gridId;
private String gridName; private String gridName;
private String agencyId;
@JsonIgnore //@JsonIgnore
private String categoryCode; private String categoryCode;
private String parentCode;
private String categoryName; private String categoryName;
@ -30,15 +31,16 @@ public class DemandRecResultDTO implements Serializable {
private String content; private String content;
private String reportUserName; private String reportUserName;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") private String reportUserMobile;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reportTime; private Date reportTime;
private String demandUserId; private String demandUserId;
private String demandUser; private String demandUser;
private String demandUserName; private String demandUserName;
private String demandUserMobile; private String demandUserMobile;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String wantServiceTime; private Date wantServiceTime;
/** /**
* 待处理pending已取消canceled已派单assigned已接单have_order已完成finished * 待处理pending已取消canceled已派单assigned已接单have_order已完成finished
@ -55,6 +57,7 @@ public class DemandRecResultDTO implements Serializable {
/** /**
* 取消时间 * 取消时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date cancelTime; private Date cancelTime;
/** /**
@ -97,13 +100,13 @@ public class DemandRecResultDTO implements Serializable {
/** /**
* 实际服务开始时间 * 实际服务开始时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceStartTime; private Date serviceStartTime;
/** /**
* 实际服务结束时间 * 实际服务结束时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date serviceEndTime; private Date serviceEndTime;
/** /**

46
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcCommunitySelfOrganizationController.java

@ -18,6 +18,7 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
@ -28,17 +29,17 @@ import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.IcCommunitySelfOrganizationDTO;
import com.epmet.dto.form.AddCommunitySelfOrganizationFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.CommunitySelfOrganizationListFormDTO;
import com.epmet.dto.form.DelCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.EditCommunitySelfOrganizationFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.ExportCommunitySelfOrganizationExcel;
import com.epmet.excel.IcCommunitySelfOrganizationExcel; import com.epmet.excel.IcCommunitySelfOrganizationExcel;
import com.epmet.service.IcCommunitySelfOrganizationService; import com.epmet.service.IcCommunitySelfOrganizationService;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.util.List;
@ -100,6 +101,43 @@ public class IcCommunitySelfOrganizationController {
ExcelUtils.exportExcelToTarget(response, null, list, IcCommunitySelfOrganizationExcel.class); ExcelUtils.exportExcelToTarget(response, null, list, IcCommunitySelfOrganizationExcel.class);
} }
/**
* @Description 导出 社区自组织查询列表
* @param response
* @param tokenDto
* @param formDTO
* @author zxc
* @date 2021/11/24 10:59 上午
*/
@PostMapping("exportcommunityselforganization")
public void exportCommunitySelfOrganization(HttpServletResponse response,@LoginUser TokenDto tokenDto,@RequestBody CommunitySelfOrganizationListFormDTO formDTO) throws Exception {
CommunitySelfOrganizationListResultDTO resultDTO = icCommunitySelfOrganizationService.communitySelfOrganizationList(tokenDto, formDTO);
ExcelUtils.exportExcelToTarget(response, null, resultDTO.getList(), ExportCommunitySelfOrganizationExcel.class);
}
/**
* @Description 导入
* @param tokenDto
* @param response
* @param file
* @author zxc
* @date 2021/11/25 9:03 上午
*/
@PostMapping("importcommunityselforganization")
public Result importCommunitySelfOrganization(@LoginUser TokenDto tokenDto, HttpServletResponse response, @RequestPart("file") MultipartFile file) throws Exception {
if (file.isEmpty()) {
throw new RenException("请上传文件");
}
// 校验文件类型
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
throw new RenException("文件类型不匹配");
}
icCommunitySelfOrganizationService.importCommunitySelfOrganization(tokenDto, response, file);
return new Result();
}
/** /**
* @Description 添加社区自组织 * @Description 添加社区自组织
* @param tokenDto * @param tokenDto

6
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyActivityController.java

@ -17,7 +17,9 @@
package com.epmet.controller; package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -62,10 +64,10 @@ public class IcPartyActivityController {
} }
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody IcPartyActivityDTO dto){ public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyActivityDTO dto){
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icPartyActivityService.save(dto); icPartyActivityService.save(tokenDto, dto);
return new Result(); return new Result();
} }

5
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcPartyUnitController.java

@ -69,10 +69,11 @@ public class IcPartyUnitController {
} }
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody IcPartyUnitDTO dto){ public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartyUnitDTO dto){
//效验数据 //效验数据
dto.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icPartyUnitService.save(dto); icPartyUnitService.save(tokenDto, dto);
return new Result(); return new Result();
} }

69
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/controller/IcSocietyOrgController.java

@ -17,24 +17,37 @@
package com.epmet.controller; package com.epmet.controller;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.AddSocietyOrgFormDTO; import com.epmet.dto.form.AddSocietyOrgFormDTO;
import com.epmet.dto.form.EditSocietyOrgFormDTO; import com.epmet.dto.form.EditSocietyOrgFormDTO;
import com.epmet.dto.form.GetListPlaceOrgFormDTO;
import com.epmet.dto.form.GetListSocietyOrgFormDTO; import com.epmet.dto.form.GetListSocietyOrgFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.GetListPlaceOrgResultDTO;
import com.epmet.dto.result.GetListSocietyOrgResultDTO; import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.excel.IcSocietyOrgExcel;
import com.epmet.service.IcSocietyOrgService; import com.epmet.service.IcSocietyOrgService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
@ -43,6 +56,7 @@ import java.util.List;
* @author generator generator@elink-cn.com * @author generator generator@elink-cn.com
* @since v1.0.0 2021-11-18 * @since v1.0.0 2021-11-18
*/ */
@Slf4j
@RestController @RestController
@RequestMapping("societyorg") @RequestMapping("societyorg")
public class IcSocietyOrgController { public class IcSocietyOrgController {
@ -92,6 +106,7 @@ public class IcSocietyOrgController {
@PostMapping("getlist") @PostMapping("getlist")
public Result<GetListSocietyOrgResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO) { public Result<GetListSocietyOrgResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<GetListSocietyOrgResultDTO>().ok(societyOrgService.getList(formDTO)); return new Result<GetListSocietyOrgResultDTO>().ok(societyOrgService.getList(formDTO));
} }
@ -108,4 +123,50 @@ public class IcSocietyOrgController {
ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class,ServiceQueryFormDTO.SocietyOrgInternalGroup.class); ValidatorUtils.validateEntity(formDTO,ServiceQueryFormDTO.AddUserInternalGroup.class,ServiceQueryFormDTO.SocietyOrgInternalGroup.class);
return new Result<List<OptionDTO>>().ok(societyOrgService.queryServiceList(formDTO)); return new Result<List<OptionDTO>>().ok(societyOrgService.queryServiceList(formDTO));
} }
/**
* @Author sun
* @Description 九小场所下组织列表导出
**/
@PostMapping("export")
public void export(@LoginUser TokenDto tokenDto, @RequestBody GetListSocietyOrgFormDTO formDTO, HttpServletResponse response) throws Exception {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
formDTO.setIsPage(false);
GetListSocietyOrgResultDTO list = societyOrgService.getList(formDTO);
ExcelUtils.exportExcelToTarget(response, null, list.getList(), IcSocietyOrgExcel.class);
}
/**
* @Author sun
* @Description 九小场所下组织列表导入
**/
@PostMapping("import")
public Result importExcel(@LoginUser TokenDto tokenDTO, @RequestParam("file") MultipartFile file) throws IOException, ParseException {
ExcelImportResult<IcSocietyOrgExcel> importResult = ExcelPoiUtils.importExcelMore(file, 0, 1, IcSocietyOrgExcel.class);
List<IcSocietyOrgExcel> failList = importResult.getFailList();
//存放错误数据行号
List<Integer> numList = new ArrayList<>();
if (!CollectionUtils.isEmpty(failList)) {
for (IcSocietyOrgExcel entity : failList) {
log.warn("第{}行,{}", entity.getRowNum(), entity.getErrorMsg());//打印失败的行 和失败的信息
numList.add(entity.getRowNum());
}
//return new Result().error(8001,failList.get(0).getErrorMsg());
}
List<IcSocietyOrgExcel> result = importResult.getList();
List<Integer> resultList = societyOrgService.importExcel(tokenDTO.getCustomerId(), result, tokenDTO.getUserId(), numList);
String str = String.format("共%s条,成功导入%s条。", numList.size() + result.size(), numList.size() + result.size() - resultList.size());
if (resultList.size() > NumConstant.ZERO) {
Collections.sort(resultList);
String subList = resultList.stream().map(String::valueOf).collect(Collectors.joining("、"));
log.warn(str + "第" + subList + "行未成功!");
return new Result().error(9999, str + "第" + subList + "行未成功!");
}
return new Result().ok(str);
}
} }

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcCommunitySelfOrganizationDao.java

@ -55,4 +55,13 @@ public interface IcCommunitySelfOrganizationDao extends BaseDao<IcCommunitySelfO
List<OptionDTO> selectListByAgencyId(@Param("customerId") String customerId, List<OptionDTO> selectListByAgencyId(@Param("customerId") String customerId,
@Param("agencyIds") List<String> agencyIds, @Param("agencyIds") List<String> agencyIds,
@Param("orgName") String orgName); @Param("orgName") String orgName);
/**
* @Description 根据名字查询存在的自组织
* @param names
* @author zxc
* @date 2021/11/25 9:07 上午
*/
List<String> selectOrgByOrgName(@Param("names")List<String> names, @Param("customerId") String customerId);
} }

7
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/dao/IcSocietyOrgDao.java

@ -18,6 +18,7 @@
package com.epmet.dao; package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcSocietyOrgDTO;
import com.epmet.dto.form.GetListSocietyOrgFormDTO; import com.epmet.dto.form.GetListSocietyOrgFormDTO;
import com.epmet.dto.result.GetListSocietyOrgResultDTO; import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.SocietyOrgListResultDTO; import com.epmet.dto.result.SocietyOrgListResultDTO;
@ -53,4 +54,10 @@ public interface IcSocietyOrgDao extends BaseDao<IcSocietyOrgEntity> {
@Param("societyName")String societyName, @Param("societyName")String societyName,
@Param("customerId")String customerId, @Param("customerId")String customerId,
@Param("queryPurpose")String queryPurpose); @Param("queryPurpose")String queryPurpose);
/**
* @Author sun
* @Description 查询当前组织下的社会组织数据
**/
List<IcSocietyOrgDTO> getByAgencyId(@Param("agencyId") String agencyId);
} }

31
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ExportCommunitySelfOrganizationExcel.java

@ -0,0 +1,31 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.CellStyler;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
@Data
public class ExportCommunitySelfOrganizationExcel {
@Excel(name = "排序")
private Integer sort;
@Excel(name = "组织名称", width = 40)
private String organizationName;
@Excel(name = "组织人数", width = 20)
private Integer organizationPersonCount;
@Excel(name = "负责人姓名", width = 20)
private String principalName;
@Excel(name = "负责人电话", width = 20)
private String principalPhone;
@Excel(name = "服务事项", width = 60)
private String serviceItem;
@Excel(name = "社区自组织创建时间", width = 20)
private String organizationCreatedTime;
}

61
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/IcSocietyOrgExcel.java

@ -18,8 +18,13 @@
package com.epmet.excel; package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel; import cn.afterturn.easypoi.excel.annotation.Excel;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
@ -29,40 +34,42 @@ import java.util.Date;
* @since v1.0.0 2021-11-18 * @since v1.0.0 2021-11-18
*/ */
@Data @Data
public class IcSocietyOrgExcel { public class IcSocietyOrgExcel extends ExcelVerifyInfo implements Serializable {
@Excel(name = "唯一标识") @Excel(name = "组织名称")
private String id; @NotBlank(message = "不能为空")
private String agencyName;
@Excel(name = "客户Id")
private String customerId;
@Excel(name = "组织Id")
private String agencyId;
@Excel(name = "agency_id的所有上级")
private String pids;
@Excel(name = "社会组织名称") @Excel(name = "社会组织名称")
@NotBlank(message = "不能为空")
@Length(max=50,message = "不能超过50个字")
private String societyName; private String societyName;
@Excel(name = "服务事项") @Excel(name = "服务事项")
@NotBlank(message = "不能为空")
@Length(max=1000,message = "不能超过1000个字")
private String serviceMatters; private String serviceMatters;
@Excel(name = "负责人") @Excel(name = "负责人")
@NotBlank(message = "不能为空")
@Length(max=20,message = "不能超过20个字")
private String personInCharge; private String personInCharge;
@Excel(name = "负责人电话") @Excel(name = "负责人电话")
@NotBlank(message = "不能为空")
@Length(max=11,message = "不能超过11个字")
private String mobile; private String mobile;
@Excel(name = "起始服务时间") @Excel(name = "起始服务时间")
private Date serviceStartTime; @NotBlank(message = "不能为空")
private String serviceStartTime;
@Excel(name = "终止服务时间") @Excel(name = "终止服务时间")
private Date serviceEndTime; @NotBlank(message = "不能为空")
private String serviceEndTime;
@Excel(name = "绑定管理员[组织下录入的工作人员]") @Excel(name = "管理员姓名")
private String adminStaffId; private String adminStaffName;
@Excel(name = "地址") @Excel(name = "地址")
private String address; private String address;
@ -73,26 +80,4 @@ public class IcSocietyOrgExcel {
@Excel(name = "维度") @Excel(name = "维度")
private String latitude; private String latitude;
@Excel(name = "备注")
private String remarks;
@Excel(name = "删除标识:0.未删除 1.已删除")
private Integer delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
} }

40
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganization.java

@ -0,0 +1,40 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import com.epmet.commons.tools.utils.ExcelVerifyInfo;
import lombok.Data;
import java.util.Date;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/11/24 4:34 下午
* @DESC
*/
@Data
public class ImportCommunitySelfOrganization extends ExcelVerifyInfo {
@Excel(name = "组织名称", needMerge = true)
private String organizationName;
@Excel(name = "组织人数", needMerge = true)
private Integer organizationPersonCount;
@Excel(name = "服务事项", needMerge = true)
private String serviceItem;
@Excel(name = "负责人", needMerge = true)
private String principalName;
@Excel(name = "联系电话", needMerge = true)
private String principalPhone;
@Excel(name = "创建时间", needMerge = true)
private Date organizationCreatedTime;
@ExcelCollection(name = "组织成员")
private List<ImportCommunitySelfOrganizationSon> persons;
}

20
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/excel/ImportCommunitySelfOrganizationSon.java

@ -0,0 +1,20 @@
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
/**
* @Author zxc
* @DateTime 2021/11/24 4:46 下午
* @DESC
*/
@Data
public class ImportCommunitySelfOrganizationSon {
@Excel(name = "姓名")
private String personName;
@Excel(name = "电话")
private String personPhone;
}

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcCommunitySelfOrganizationService.java

@ -29,7 +29,10 @@ import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO; import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity; import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -145,4 +148,14 @@ public interface IcCommunitySelfOrganizationService extends BaseService<IcCommun
* @return * @return
*/ */
List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO); List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO);
/**
* @Description 导入
* @param tokenDto
* @param response
* @param file
* @author zxc
* @date 2021/11/25 9:03 上午
*/
void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException;
} }

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyActivityService.java

@ -19,6 +19,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyActivityDTO;
import com.epmet.dto.form.PartyActivityFormDTO; import com.epmet.dto.form.PartyActivityFormDTO;
import com.epmet.entity.IcPartyActivityEntity; import com.epmet.entity.IcPartyActivityEntity;
@ -71,7 +72,7 @@ public interface IcPartyActivityService extends BaseService<IcPartyActivityEntit
* @author generator * @author generator
* @date 2021-11-19 * @date 2021-11-19
*/ */
void save(IcPartyActivityDTO dto); void save(TokenDto tokenDto, IcPartyActivityDTO dto);
/** /**
* 批量删除 * 批量删除

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcPartyUnitService.java

@ -19,6 +19,7 @@ package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO;
@ -73,7 +74,7 @@ public interface IcPartyUnitService extends BaseService<IcPartyUnitEntity> {
* @author generator * @author generator
* @date 2021-11-19 * @date 2021-11-19
*/ */
void save(IcPartyUnitDTO dto); void save(TokenDto tokenDto, IcPartyUnitDTO dto);
/** /**

9
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/IcSocietyOrgService.java

@ -25,7 +25,9 @@ import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.GetListSocietyOrgResultDTO; import com.epmet.dto.result.GetListSocietyOrgResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.entity.IcSocietyOrgEntity;
import com.epmet.excel.IcSocietyOrgExcel;
import java.text.ParseException;
import java.util.List; import java.util.List;
/** /**
@ -66,4 +68,11 @@ public interface IcSocietyOrgService extends BaseService<IcSocietyOrgEntity> {
* @return * @return
*/ */
List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO); List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO);
/**
* @Author sun
* @Description 九小场所下组织列表导入
**/
List<Integer> importExcel(String customerId, List<IcSocietyOrgExcel> list, String staffId, List<Integer> numList) throws ParseException;
} }

150
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcCommunitySelfOrganizationServiceImpl.java

@ -1,5 +1,6 @@
package com.epmet.service.impl; package com.epmet.service.impl;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -18,6 +19,7 @@ import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.ExcelPoiUtils;
import com.epmet.constant.IcCommunitySelfOrganizationConstant; import com.epmet.constant.IcCommunitySelfOrganizationConstant;
import com.epmet.dao.IcCommunitySelfOrganizationDao; import com.epmet.dao.IcCommunitySelfOrganizationDao;
import com.epmet.dto.IcCommunitySelfOrganizationDTO; import com.epmet.dto.IcCommunitySelfOrganizationDTO;
@ -31,6 +33,7 @@ import com.epmet.dto.result.CommunitySelfOrganizationListResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcCommunitySelfOrganizationEntity; import com.epmet.entity.IcCommunitySelfOrganizationEntity;
import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity; import com.epmet.entity.IcCommunitySelfOrganizationPersonnelEntity;
import com.epmet.excel.ImportCommunitySelfOrganization;
import com.epmet.service.IcCommunitySelfOrganizationPersonnelService; import com.epmet.service.IcCommunitySelfOrganizationPersonnelService;
import com.epmet.service.IcCommunitySelfOrganizationService; import com.epmet.service.IcCommunitySelfOrganizationService;
import com.epmet.service.IcUserDemandRecService; import com.epmet.service.IcUserDemandRecService;
@ -41,8 +44,13 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*; import java.util.*;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN; import static com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN;
@ -119,6 +127,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
* @author zxc * @author zxc
* @date 2021/11/19 8:33 上午 * @date 2021/11/19 8:33 上午
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void addCommunitySelfOrganization(TokenDto tokenDto, AddCommunitySelfOrganizationFormDTO formDTO) { public void addCommunitySelfOrganization(TokenDto tokenDto, AddCommunitySelfOrganizationFormDTO formDTO) {
String customerId = tokenDto.getCustomerId(); String customerId = tokenDto.getCustomerId();
@ -138,6 +147,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
orgEntity.setCustomerId(customerId); orgEntity.setCustomerId(customerId);
orgEntity.setOrgId(staffInfo.getAgencyId()); orgEntity.setOrgId(staffInfo.getAgencyId());
orgEntity.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY); orgEntity.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY);
orgEntity.setOrganizationCreatedTime(DateUtils.parse(formDTO.getOrganizationCreatedTime(), DATE_PATTERN));
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId()); AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){ if (null == agencyInfo){
throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId())); throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId()));
@ -154,6 +164,22 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
baseDao.insert(orgEntity); baseDao.insert(orgEntity);
if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ if(CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){
List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class);
Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone));
List<String> phones = new ArrayList<>();
groupPhone.forEach((k,v) -> {
if (v.size() > NumConstant.ONE){
phones.add(k);
}
});
if (CollectionUtils.isNotEmpty(phones)){
StringBuffer sb = new StringBuffer();
phones.forEach(p -> {
sb.append(p).append(",");
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode());
}
persons.forEach(p -> { persons.forEach(p -> {
p.setCustomerId(customerId); p.setCustomerId(customerId);
p.setOrgId(orgEntity.getId()); p.setOrgId(orgEntity.getId());
@ -170,6 +196,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
* @author zxc * @author zxc
* @date 2021/11/19 10:12 上午 * @date 2021/11/19 10:12 上午
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void editCommunitySelfOrganization(TokenDto tokenDto, EditCommunitySelfOrganizationFormDTO formDTO) { public void editCommunitySelfOrganization(TokenDto tokenDto, EditCommunitySelfOrganizationFormDTO formDTO) {
LambdaQueryWrapper<IcCommunitySelfOrganizationEntity> l = new LambdaQueryWrapper<>(); LambdaQueryWrapper<IcCommunitySelfOrganizationEntity> l = new LambdaQueryWrapper<>();
@ -188,6 +215,22 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
personnelService.deleteByOrgId(formDTO.getOrgId()); personnelService.deleteByOrgId(formDTO.getOrgId());
if (CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){ if (CollectionUtils.isNotEmpty(formDTO.getOrganizationPersonnel())){
List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class); List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(formDTO.getOrganizationPersonnel(), IcCommunitySelfOrganizationPersonnelEntity.class);
Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone));
List<String> phones = new ArrayList<>();
groupPhone.forEach((k,v) -> {
if (v.size() > NumConstant.ONE){
phones.add(k);
}
});
if (CollectionUtils.isNotEmpty(phones)){
StringBuffer sb = new StringBuffer();
phones.forEach(p -> {
sb.append(p).append(",");
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode());
}
persons.forEach(p -> { persons.forEach(p -> {
p.setOrgId(formDTO.getOrgId()); p.setOrgId(formDTO.getOrgId());
p.setCustomerId(tokenDto.getCustomerId()); p.setCustomerId(tokenDto.getCustomerId());
@ -213,14 +256,26 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE}; final int[] i = {(formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize() + NumConstant.ONE};
CommunitySelfOrganizationListResultDTO result = new CommunitySelfOrganizationListResultDTO(); CommunitySelfOrganizationListResultDTO result = new CommunitySelfOrganizationListResultDTO();
PageInfo<CommunitySelfOrganizationListDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO)); if (formDTO.getIsPage()){
result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal()))); PageInfo<CommunitySelfOrganizationListDTO> objectPageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectCommunitySelfOrganizationList(formDTO));
if (CollectionUtils.isNotEmpty(objectPageInfo.getList())){ result.setTotal(Integer.valueOf(String.valueOf(objectPageInfo.getTotal())));
objectPageInfo.getList().forEach(l -> { if (CollectionUtils.isNotEmpty(objectPageInfo.getList())){
l.setSort(i[NumConstant.ZERO]); objectPageInfo.getList().forEach(l -> {
i[NumConstant.ZERO]++; l.setSort(i[NumConstant.ZERO]);
i[NumConstant.ZERO]++;
});
result.setList(objectPageInfo.getList());
}
return result;
}
List<CommunitySelfOrganizationListDTO> resultDTOs = baseDao.selectCommunitySelfOrganizationList(formDTO);
if (CollectionUtils.isNotEmpty(resultDTOs)){
result.setTotal(resultDTOs.size());
AtomicReference<Integer> sort = new AtomicReference<>(NumConstant.ONE);
resultDTOs.forEach(r -> {
r.setSort(sort.getAndSet(sort.get() + NumConstant.ONE));
}); });
result.setList(objectPageInfo.getList()); result.setList(resultDTOs);
} }
return result; return result;
} }
@ -232,6 +287,7 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
* @author zxc * @author zxc
* @date 2021/11/19 4:22 下午 * @date 2021/11/19 4:22 下午
*/ */
@Transactional(rollbackFor = Exception.class)
@Override @Override
public void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO) { public void delCommunitySelfOrganization(DelCommunitySelfOrganizationFormDTO formDTO) {
baseDao.deleteById(formDTO.getOrgId()); baseDao.deleteById(formDTO.getOrgId());
@ -256,6 +312,9 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){ if(staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)){
agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
}else{
//当前用户属于第二级组织的人,不会有:
agencyIds.add(staffInfoCacheResult.getAgencyPIds());
} }
} }
agencyIds.add(staffInfoCacheResult.getAgencyId()); agencyIds.add(staffInfoCacheResult.getAgencyId());
@ -263,4 +322,81 @@ public class IcCommunitySelfOrganizationServiceImpl extends BaseServiceImpl<IcCo
return resultList; return resultList;
} }
/**
* @Description 导入
* @param tokenDto
* @param response
* @param file
* @author zxc
* @date 2021/11/25 9:03 上午
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void importCommunitySelfOrganization(TokenDto tokenDto, HttpServletResponse response, MultipartFile file) throws IOException {
ExcelImportResult<ImportCommunitySelfOrganization> testExcelImportResult = ExcelPoiUtils.importExcelMore(file, 0, 2, ImportCommunitySelfOrganization.class);
List<ImportCommunitySelfOrganization> list = testExcelImportResult.getList();
if (CollectionUtils.isNotEmpty(list)){
String customerId = tokenDto.getCustomerId();
List<String> existsNames = baseDao.selectOrgByOrgName(list.stream().map(m -> m.getOrganizationName()).collect(Collectors.toList()), customerId);
Map<String, List<ImportCommunitySelfOrganization>> groupByName = list.stream().collect(Collectors.groupingBy(ImportCommunitySelfOrganization::getOrganizationName));
groupByName.forEach((k,v) -> {
if (v.size() > NumConstant.ONE){
existsNames.add(k);
}
});
List<String> repeatName = existsNames.stream().distinct().collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(repeatName)){
StringBuffer sb = new StringBuffer();
repeatName.forEach(p -> {
sb.append(p).append(",");
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.setMsg(String.format(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.COMMUNITY_SELF_ORGANIZATION_LIST_REPART_ERROR.getCode());
}
CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
if (null == staffInfo){
throw new RenException(String.format("查询人员{%s}信息失败",tokenDto.getUserId()));
}
AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(staffInfo.getAgencyId());
if (null == agencyInfo){
throw new RenException(String.format("查询组织信息失败%s",staffInfo.getAgencyId()));
}
list.forEach(l -> {
IcCommunitySelfOrganizationEntity e = ConvertUtils.sourceToTarget(l, IcCommunitySelfOrganizationEntity.class);
e.setCustomerId(customerId);
e.setOrgId(staffInfo.getAgencyId());
e.setOrgType(IcCommunitySelfOrganizationConstant.ORG_TYPE_AGENCY);
e.setPid(agencyInfo.getPid());
e.setPids(agencyInfo.getPids());
e.setOrganizationCreatedTime(l.getOrganizationCreatedTime());
baseDao.insert(e);
if (CollectionUtils.isNotEmpty(l.getPersons())){
List<IcCommunitySelfOrganizationPersonnelEntity> persons = ConvertUtils.sourceToTarget(l.getPersons(), IcCommunitySelfOrganizationPersonnelEntity.class);
Map<String, List<IcCommunitySelfOrganizationPersonnelEntity>> groupByPhone = persons.stream().collect(Collectors.groupingBy(IcCommunitySelfOrganizationPersonnelEntity::getPersonPhone));
List<String> phones = new ArrayList<>();
groupByPhone.forEach((k,v) -> {
if (v.size() > NumConstant.ONE){
phones.add(k);
}
});
if (CollectionUtils.isNotEmpty(phones)){
StringBuffer sb = new StringBuffer();
phones.forEach(p -> {
sb.append(p).append(",");
});
String copywriter = sb.toString().substring(NumConstant.ZERO, sb.length() - NumConstant.ONE);
EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.setMsg(String.format(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getMsg(),copywriter));
throw new RenException(EpmetErrorCode.EXISTS_SAME_PHONE_ERROR.getCode());
}
persons.forEach(p -> {
p.setCustomerId(customerId);
p.setOrgId(e.getId());
});
personnelService.insertBatch(persons);
}
});
}
}
} }

13
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyActivityServiceImpl.java

@ -21,9 +21,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.dao.IcPartyActivityDao; import com.epmet.dao.IcPartyActivityDao;
import com.epmet.dto.IcPartyActivityDTO; import com.epmet.dto.IcPartyActivityDTO;
@ -123,10 +124,12 @@ public class IcPartyActivityServiceImpl extends BaseServiceImpl<IcPartyActivityD
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(IcPartyActivityDTO dto) { public void save(TokenDto tokenDto, IcPartyActivityDTO dto) {
IcPartyActivityEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyActivityEntity.class); IcPartyActivityEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyActivityEntity.class);
AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId()); CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
entity.setPids(agency.getPids()); entity.setCustomerId(tokenDto.getCustomerId());
entity.setAgencyId(staff.getAgencyId());
entity.setPids(staff.getAgencyPIds());
if(StringUtils.isBlank(entity.getId())) { if(StringUtils.isBlank(entity.getId())) {
insert(entity); insert(entity);
} else { } else {

40
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcPartyUnitServiceImpl.java

@ -21,16 +21,18 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.DictTypeEnum; import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcPartyUnitDao; import com.epmet.dao.IcPartyUnitDao;
import com.epmet.dto.IcPartyUnitDTO; import com.epmet.dto.IcPartyUnitDTO;
import com.epmet.dto.IcUserDemandRecDTO;
import com.epmet.dto.form.PartyUnitFormDTO; import com.epmet.dto.form.PartyUnitFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.form.demand.SubCodeFormDTO; import com.epmet.dto.form.demand.SubCodeFormDTO;
@ -149,10 +151,14 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(IcPartyUnitDTO dto) { public void save(TokenDto tokenDto, IcPartyUnitDTO dto) {
IcPartyUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitEntity.class); IcPartyUnitEntity entity = ConvertUtils.sourceToTarget(dto, IcPartyUnitEntity.class);
AgencyInfoCache agency = CustomerOrgRedis.getAgencyInfo(entity.getAgencyId()); CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
entity.setPids(agency.getPids()); entity.setAgencyId(staff.getAgencyId());
entity.setPids(staff.getAgencyPIds());
if (CollectionUtils.isNotEmpty(dto.getServiceMatterList())) {
entity.setServiceMatter(StringUtils.join(dto.getServiceMatterList(), StrConstant.COMMA));
}
if(StringUtils.isBlank(entity.getId())) { if(StringUtils.isBlank(entity.getId())) {
insert(entity); insert(entity);
} else { } else {
@ -177,17 +183,21 @@ public class IcPartyUnitServiceImpl extends BaseServiceImpl<IcPartyUnitDao, IcPa
*/ */
@Override @Override
public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) { public List<OptionDTO> queryServiceList(ServiceQueryFormDTO formDTO) {
List<OptionDTO> resultList=new ArrayList<>(); List<OptionDTO> resultList = new ArrayList<>();
IcUserDemandRecDTO icUserDemandRecDTO=icUserDemandRecService.get(formDTO.getDemandRecId()); CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
if(null==icUserDemandRecDTO|| org.springframework.util.StringUtils.isEmpty(icUserDemandRecDTO.getGridPids())){ if (null == staffInfoCacheResult || StringUtils.isBlank(staffInfoCacheResult.getAgencyId())) {
return resultList; throw new RenException("工作人员所属组织信息查询异常");
} }
List<String> agencyIds=new ArrayList<>(); List<String> agencyIds = new ArrayList<>();
if(icUserDemandRecDTO.getGridPids().contains(StrConstant.COLON)){ if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
agencyIds.addAll(Arrays.asList(icUserDemandRecDTO.getGridPids().split(StrConstant.COLON))); if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) {
}else{ agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
agencyIds.add(icUserDemandRecDTO.getGridPids()); }else{
//当前用户属于第二级组织的人,不会有:
agencyIds.add(staffInfoCacheResult.getAgencyPIds());
}
} }
agencyIds.add(staffInfoCacheResult.getAgencyId());
resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId()); resultList=baseDao.selectListByAgencyId(agencyIds,formDTO.getServiceName(),formDTO.getCustomerId());
return resultList; return resultList;
} }

131
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcSocietyOrgServiceImpl.java

@ -26,17 +26,16 @@ import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.IcSocietyOrgDao; import com.epmet.dao.IcSocietyOrgDao;
import com.epmet.dto.form.AddSocietyOrgFormDTO; import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.EditSocietyOrgFormDTO; import com.epmet.dto.IcSocietyOrgDTO;
import com.epmet.dto.form.GetListSocietyOrgFormDTO; import com.epmet.dto.form.*;
import com.epmet.dto.form.UserIdsFormDTO;
import com.epmet.dto.form.demand.ServiceQueryFormDTO; import com.epmet.dto.form.demand.ServiceQueryFormDTO;
import com.epmet.dto.result.GetListSocietyOrgResultDTO; import com.epmet.dto.result.*;
import com.epmet.dto.result.SocietyOrgListResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.dto.result.demand.OptionDTO; import com.epmet.dto.result.demand.OptionDTO;
import com.epmet.entity.IcSocietyOrgEntity; import com.epmet.entity.IcSocietyOrgEntity;
import com.epmet.excel.IcSocietyOrgExcel;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcSocietyOrgService; import com.epmet.service.IcSocietyOrgService;
import com.epmet.service.IcUserDemandRecService; import com.epmet.service.IcUserDemandRecService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
@ -49,9 +48,9 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.text.ParseException;
import java.util.Arrays; import java.text.SimpleDateFormat;
import java.util.List; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -67,6 +66,8 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired @Autowired
private IcUserDemandRecService icUserDemandRecService; private IcUserDemandRecService icUserDemandRecService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/** /**
* @Author sun * @Author sun
@ -115,13 +116,16 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
@Override @Override
public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) { public GetListSocietyOrgResultDTO getList(GetListSocietyOrgFormDTO formDTO) {
GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO(); GetListSocietyOrgResultDTO resultDTO = new GetListSocietyOrgResultDTO();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setPids(staffInfoCache.getAgencyPIds());
//1.根据查询条件分页查询社会组织数据 //1.根据查询条件分页查询社会组织数据
PageInfo<SocietyOrgListResultDTO> result = PageInfo<SocietyOrgListResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO)); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO));
if (CollectionUtils.isEmpty(result.getList())) { if (CollectionUtils.isEmpty(result.getList())) {
return resultDTO; return resultDTO;
} }
resultDTO.setTotal((int) result.getTotal()); resultDTO.setTotal((int) result.getTotal());
//2.查询被绑定管理员信息 //2.查询被绑定管理员信息
UserIdsFormDTO dto = new UserIdsFormDTO(); UserIdsFormDTO dto = new UserIdsFormDTO();
List<String> staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList()); List<String> staffIdList = result.getList().stream().map(SocietyOrgListResultDTO::getAdminStaffId).collect(Collectors.toList());
@ -132,8 +136,20 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
throw new RenException("获取工作人员基本信息失败......"); throw new RenException("获取工作人员基本信息失败......");
} }
result.getList().forEach(r -> listResult.getData().stream().filter(u -> r.getAdminStaffId().equals(u.getStaffId())).forEach(u -> r.setAdminStaffName(u.getStaffName()))); result.getList().forEach(r -> listResult.getData().stream().filter(u -> r.getAdminStaffId().equals(u.getStaffId())).forEach(u -> r.setAdminStaffName(u.getStaffName())));
resultDTO.setList(result.getList());
//3.查询被绑定管理员信息
OrgInfoFormDTO org = new OrgInfoFormDTO();
List<String> orgIds = result.getList().stream().map(SocietyOrgListResultDTO::getAgencyId).collect(Collectors.toList());
orgIds = orgIds.stream().distinct().collect(Collectors.toList());
org.setOrgIds(orgIds);
org.setOrgType("agency");
Result<List<OrgInfoResultDTO>> orgResult = govOrgOpenFeignClient.selectOrgInfo(org);
if (!orgResult.success()) {
throw new RenException("获取组织基础信息失败......");
}
result.getList().forEach(r -> orgResult.getData().stream().filter(u -> r.getAgencyId().equals(u.getOrgId())).forEach(u -> r.setAgencyName(u.getOrgName())));
resultDTO.setList(result.getList());
return resultDTO; return resultDTO;
} }
@ -154,6 +170,9 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) { if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) { if (staffInfoCacheResult.getAgencyPIds().contains(StrConstant.COLON)) {
agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON))); agencyIds.addAll(Arrays.asList(staffInfoCacheResult.getAgencyPIds().split(StrConstant.COLON)));
}else{
//当前用户属于第二级组织的人,不会有:
agencyIds.add(staffInfoCacheResult.getAgencyPIds());
} }
} }
agencyIds.add(staffInfoCacheResult.getAgencyId()); agencyIds.add(staffInfoCacheResult.getAgencyId());
@ -161,4 +180,92 @@ public class IcSocietyOrgServiceImpl extends BaseServiceImpl<IcSocietyOrgDao, Ic
return resultList; return resultList;
} }
/**
* @Author sun
* @Description 九小场所下组织列表导入
**/
@Override
public List<Integer> importExcel(String customerId, List<IcSocietyOrgExcel> list, String staffId, List<Integer> numList) throws ParseException {
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, staffId);
//查询当前组织下的社会组织数据
List<IcSocietyOrgDTO> societyOrgList = baseDao.getByAgencyId(staffInfoCache.getAgencyId());
//1.数据校验 只允许导入当前组织下社会组织且是当前组织下不存在的社会组织
//组织名称不一样的数据舍弃
Iterator<IcSocietyOrgExcel> iterator = list.iterator();
while (iterator.hasNext()) {
IcSocietyOrgExcel obj = iterator.next();
if (!obj.getAgencyName().trim().equals(staffInfoCache.getAgencyName())) {
numList.add(obj.getRowNum());
log.warn(String.format("不是当前组织下可导入的数据,组织名称->%s,行号->%s", obj.getAgencyName(), obj.getRowNum()));
iterator.remove();
continue;
}
societyOrgList.forEach(org -> {
if (obj.getSocietyName().equals(org.getSocietyName())) {
numList.add(obj.getRowNum());
log.warn(String.format("当前组织下的社会组织已存在,社会组织名称->%s,行号->%s", obj.getSocietyName(), obj.getRowNum()));
iterator.remove();
}
});
}
if (CollectionUtils.isEmpty(list)) {
return numList;
}
//2.查询绑定的管理员信息
Set<String> staffNames = list.stream().map(item -> item.getAdminStaffName().trim()).collect(Collectors.toSet());
GetByRealNamesFormDTO dto = new GetByRealNamesFormDTO();
dto.setCustomerId(customerId);
dto.setRealNames(staffNames);
Result<List<CustomerStaffDTO>> staffResult = epmetUserOpenFeignClient.getByRealNames(dto);
if (!staffResult.success()) {
throw new RenException("获取工作人员基础信息失败......");
}
if (null == staffResult.getData()) {
Iterator<IcSocietyOrgExcel> iter = list.iterator();
while (iter.hasNext()) {
IcSocietyOrgExcel obj = iter.next();
numList.add(obj.getRowNum());
iterator.remove();
}
return numList;
}
Map<String, String> map = staffResult.getData().stream().collect(Collectors.toMap(CustomerStaffDTO::getRealName, CustomerStaffDTO::getUserId));
//3.遍历封装有效数据
List<IcSocietyOrgEntity> houseEntityList = new ArrayList<>();
Iterator<IcSocietyOrgExcel> iterator1 = list.iterator();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
while (iterator1.hasNext()) {
IcSocietyOrgExcel icHouseExcel = iterator1.next();
IcSocietyOrgEntity entity = new IcSocietyOrgEntity();
entity.setCustomerId(customerId);
entity.setAgencyId(staffInfoCache.getAgencyId());
entity.setPids(staffInfoCache.getAgencyPIds());
entity.setSocietyName(icHouseExcel.getSocietyName());
entity.setServiceMatters(icHouseExcel.getServiceMatters());
entity.setPersonInCharge(icHouseExcel.getPersonInCharge());
entity.setMobile(icHouseExcel.getMobile());
entity.setServiceStartTime(sdf.parse(icHouseExcel.getServiceStartTime()));
entity.setServiceEndTime(sdf.parse(icHouseExcel.getServiceEndTime()));
entity.setAdminStaffId(map.containsKey(icHouseExcel.getAdminStaffName().trim()) ? map.get(icHouseExcel.getAdminStaffName().trim()) : "");
if ("".equals(entity.getAdminStaffId())) {
numList.add(icHouseExcel.getRowNum());
log.warn(String.format("绑定的管理员不存在,管理员名称->%s,行号->%s", icHouseExcel.getAdminStaffName(), icHouseExcel.getRowNum()));
iterator1.remove();
continue;
}
entity.setAddress(icHouseExcel.getAddress());
entity.setLongitude(icHouseExcel.getLongitude());
entity.setLatitude(icHouseExcel.getLatitude());
houseEntityList.add(entity);
}
//3.批量保存数据
insertBatch(houseEntityList);
return numList;
}
} }

10
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/IcUserDemandRecServiceImpl.java

@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.EpmetErrorCode;
@ -205,12 +206,11 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
if (null == staffInfo) { if (null == staffInfo) {
throw new RenException("工作人员所属组织信息查询异常"); throw new RenException("工作人员所属组织信息查询异常");
} }
if (StringUtils.isBlank(staffInfo.getAgencyPIds())) { if (StringUtils.isBlank(staffInfo.getAgencyPIds())|| NumConstant.ZERO_STR.equals(staffInfo.getAgencyPIds())) {
//当前用户属于根组织下的人
formDTO.setGridPids(staffInfo.getAgencyId()); formDTO.setGridPids(staffInfo.getAgencyId());
} else { } else {
if (staffInfo.getAgencyPIds().contains(StrConstant.COLON)) { formDTO.setGridPids(staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId()));
formDTO.setGridPids(staffInfo.getAgencyPIds().concat(StrConstant.COLON).concat(staffInfo.getAgencyId()));
}
} }
PageInfo<DemandRecResultDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(), PageInfo<DemandRecResultDTO> pageInfo= PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO)); formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.pageSelect(formDTO));
@ -417,7 +417,7 @@ public class IcUserDemandRecServiceImpl extends BaseServiceImpl<IcUserDemandRecD
operateLogDao.insert(logEntity); operateLogDao.insert(logEntity);
//3、更新服务记录 //3、更新服务记录
IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServerId()); IcUserDemandServiceEntity serviceEntity=demandServiceDao.selectById(formDTO.getServiceId());
if(null==serviceEntity){ if(null==serviceEntity){
throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg()); throw new RenException(EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getCode(), EpmetErrorCode.DEMAND_SERVICE_NOT_EXITS.getMsg());
} }

18
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcCommunitySelfOrganizationDao.xml

@ -54,7 +54,6 @@
so.LATITUDE AS latitude, so.LATITUDE AS latitude,
so.ID as orgId so.ID as orgId
FROM ic_community_self_organization so FROM ic_community_self_organization so
# LEFT JOIN ic_community_self_organization_personnel op ON (op.ORG_ID = so.ID AND op.DEL_FLAG = 0)
WHERE so.DEL_FLAG = 0 WHERE so.DEL_FLAG = 0
AND so.ORG_ID = #{agencyId} AND so.ORG_ID = #{agencyId}
AND so.CUSTOMER_ID = #{customerId} AND so.CUSTOMER_ID = #{customerId}
@ -62,10 +61,10 @@
AND so.ORGANIZATION_NAME LIKE CONCAT('%',#{organizationName},'%') AND so.ORGANIZATION_NAME LIKE CONCAT('%',#{organizationName},'%')
</if> </if>
<if test=" null != startTime and startTime != '' "> <if test=" null != startTime and startTime != '' ">
AND DATE_FORMAT(so.ORGANIZATION_CREATED_TIME,'%Y%m%d') <![CDATA[ >= ]]> #{startTime} AND so.ORGANIZATION_CREATED_TIME <![CDATA[ >= ]]> #{startTime}
</if> </if>
<if test="null != endTime and endTime != '' "> <if test="null != endTime and endTime != '' ">
AND DATE_FORMAT(so.ORGANIZATION_CREATED_TIME,'%Y%m%d') <![CDATA[ <= ]]> #{endTime} AND so.ORGANIZATION_CREATED_TIME <![CDATA[ <= ]]> #{endTime}
</if> </if>
ORDER BY so.ORGANIZATION_CREATED_TIME DESC ORDER BY so.ORGANIZATION_CREATED_TIME DESC
</select> </select>
@ -85,4 +84,17 @@
</if> </if>
</foreach> </foreach>
</select> </select>
<!-- 根据名字查询存在的自组织 -->
<select id="selectOrgByOrgName" resultType="java.lang.String">
SELECT
ORGANIZATION_NAME
FROM ic_community_self_organization
WHERE DEL_FLAG = 0
AND CUSTOMER_ID = #{customerId}
AND ORGANIZATION_NAME IN
<foreach collection="names" item="n" open="(" close=")" separator=",">
#{n}
</foreach>
</select>
</mapper> </mapper>

14
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcResiDemandDictDao.xml

@ -23,6 +23,7 @@
<result column="customerId"/> <result column="customerId"/>
<result column="value" property="value"/> <result column="value" property="value"/>
<result column="label" property="label"/> <result column="label" property="label"/>
<result column="PARENT_CODE" property="pValue"/>
<collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO" <collection property="children" ofType="com.epmet.commons.tools.dto.result.OptionResultDTO"
select="selectChildDemands" column="customerId=customerId,parentCode=value"> select="selectChildDemands" column="customerId=customerId,parentCode=value">
</collection> </collection>
@ -31,7 +32,8 @@
SELECT SELECT
CUSTOMER_ID AS customerId, CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value", CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label" CATEGORY_NAME AS "label",
PARENT_CODE as pValue
FROM FROM
ic_resi_demand_dict ic_resi_demand_dict
WHERE WHERE
@ -45,7 +47,8 @@
SELECT SELECT
CUSTOMER_ID AS customerId, CUSTOMER_ID AS customerId,
CATEGORY_CODE AS "value", CATEGORY_CODE AS "value",
CATEGORY_NAME AS "label" CATEGORY_NAME AS "label",
PARENT_CODE as pValue
FROM FROM
ic_resi_demand_dict ic_resi_demand_dict
WHERE WHERE
@ -202,13 +205,16 @@
SELECT SELECT
d.CATEGORY_CODE, d.CATEGORY_CODE,
d.PARENT_CODE, d.PARENT_CODE,
concat( p.CATEGORY_NAME, '-', d.CATEGORY_NAME ) AS CATEGORY_NAME (
case when d.level='1' then d.category_name
when d.level='2' then concat( p.CATEGORY_NAME, '-', d.CATEGORY_NAME )
end
)AS CATEGORY_NAME
FROM FROM
ic_resi_demand_dict d ic_resi_demand_dict d
LEFT JOIN ic_resi_demand_dict p ON ( d.PARENT_CODE = p.CATEGORY_CODE AND p.CUSTOMER_ID = #{customerId} ) LEFT JOIN ic_resi_demand_dict p ON ( d.PARENT_CODE = p.CATEGORY_CODE AND p.CUSTOMER_ID = #{customerId} )
WHERE WHERE
d.DEL_FLAG = '0' d.DEL_FLAG = '0'
AND d.`LEVEL` = '2'
AND d.CUSTOMER_ID = #{customerId} AND d.CUSTOMER_ID = #{customerId}
<if test="null!=cateogryCodes and cateogryCodes.size()>0"> <if test="null!=cateogryCodes and cateogryCodes.size()>0">
and d.category_code in and d.category_code in

29
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcSocietyOrgDao.xml

@ -24,6 +24,9 @@
<if test="customerId != null and customerId.trim() != ''"> <if test="customerId != null and customerId.trim() != ''">
AND customer_id = #{customerId} AND customer_id = #{customerId}
</if> </if>
<if test="pids != null and pids.trim() != ''">
AND pids LIKE CONCAT('%', #{pids}, '%')
</if>
<if test="societyName != null and societyName.trim() != ''"> <if test="societyName != null and societyName.trim() != ''">
AND society_name LIKE CONCAT('%', #{societyName}, '%') AND society_name LIKE CONCAT('%', #{societyName}, '%')
</if> </if>
@ -45,8 +48,8 @@
<select id="selectListByAgencyId" parameterType="map" resultType="com.epmet.dto.result.demand.OptionDTO"> <select id="selectListByAgencyId" parameterType="map" resultType="com.epmet.dto.result.demand.OptionDTO">
<foreach collection="agencyIds" item="agencyId" separator=" UNION "> <foreach collection="agencyIds" item="agencyId" separator=" UNION ">
SELECT SELECT
id as label, id as `value`,
society_name as `value` society_name as label
FROM FROM
ic_society_org ic_society_org
WHERE WHERE
@ -62,4 +65,26 @@
</if> </if>
</foreach> </foreach>
</select> </select>
<select id="getByAgencyId" resultType="com.epmet.dto.IcSocietyOrgDTO">
SELECT
agency_id agencyId,
id societyId,
society_name societyName,
service_matters serviceMatters,
person_in_charge personInCharge,
mobile mobile,
service_start_time serviceStartTime,
service_end_time serviceEndTime,
admin_staff_id adminStaffId,
address address,
longitude longitude,
latitude latitude
FROM
ic_society_org
WHERE
del_flag = '0'
AND agency_id = #{agencyId}
</select>
</mapper> </mapper>

19
epmet-module/epmet-heart/epmet-heart-server/src/main/resources/mapper/IcUserDemandRecDao.xml

@ -39,11 +39,14 @@
SELECT SELECT
r.ID as demandRecId, r.ID as demandRecId,
r.GRID_ID as gridId, r.GRID_ID as gridId,
r.agency_id as agencyId,
r.CATEGORY_CODE as categoryCode, r.CATEGORY_CODE as categoryCode,
r.PARENT_CODE as parentCode,
r.CONTENT, r.CONTENT,
r.REPORT_TYPE as reportType, r.REPORT_TYPE as reportType,
r.REPORT_TIME as reportTime, r.REPORT_TIME as reportTime,
r.REPORT_USER_NAME as reportUserName, r.REPORT_USER_NAME as reportUserName,
r.REPORT_USER_MOBILE as reportUserMobile,
r.`STATUS` as status, r.`STATUS` as status,
r.DEMAND_USER_ID as demandUserId, r.DEMAND_USER_ID as demandUserId,
r.DEMAND_USER_NAME as demandUserName, r.DEMAND_USER_NAME as demandUserName,
@ -90,11 +93,11 @@
<if test="null != demandUserName and demandUserName !='' "> <if test="null != demandUserName and demandUserName !='' ">
and r.DEMAND_USER_NAME like concat('%',#{demandUserName},'%') and r.DEMAND_USER_NAME like concat('%',#{demandUserName},'%')
</if> </if>
<if test=" null != reportStartDate and reportStartDate != '' "> <if test=" null != reportStartTime and reportStartTime != '' ">
AND DATE_FORMAT(r.REPORT_TIME,'%Y-%m-%d') <![CDATA[ >= ]]> #{reportStartDate} AND DATE_FORMAT(r.REPORT_TIME,'%Y-%m-%d') <![CDATA[ >= ]]> #{reportStartTime}
</if> </if>
<if test="null != reportEndDate and reportEndDate != '' "> <if test="null != reportEndTime and reportEndTime != '' ">
AND DATE_FORMAT(r.REPORT_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{reportEndDate} AND DATE_FORMAT(r.REPORT_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{reportEndTime}
</if> </if>
<if test="null != status and status != '' "> <if test="null != status and status != '' ">
and r.STATUS=#{status} and r.STATUS=#{status}
@ -105,11 +108,11 @@
<if test="null != serverId and serverId != '' "> <if test="null != serverId and serverId != '' ">
and s.SERVER_ID=#{serverId} and s.SERVER_ID=#{serverId}
</if> </if>
<if test=" null != wantServiceStartDate and wantServiceStartDate != '' "> <if test=" null != wantServiceStartTime and wantServiceStartTime != '' ">
AND DATE_FORMAT(r.WANT_SERVICE_TIME,'%Y-%m-%d') <![CDATA[ >= ]]> #{wantServiceStartDate} AND DATE_FORMAT(r.WANT_SERVICE_TIME,'%Y-%m-%d') <![CDATA[ >= ]]> #{wantServiceStartTime}
</if> </if>
<if test="null != wantServiceEndDate and wantServiceEndDate != '' "> <if test="null != wantServiceEndTime and wantServiceEndTime != '' ">
AND DATE_FORMAT(r.WANT_SERVICE_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{wantServiceEndDate} AND DATE_FORMAT(r.WANT_SERVICE_TIME,'%Y-%m-%d') <![CDATA[ <= ]]> #{wantServiceEndTime}
</if> </if>
order by r.WANT_SERVICE_TIME desc,r.CREATED_TIME asc order by r.WANT_SERVICE_TIME desc,r.CREATED_TIME asc
</select> </select>

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlaceOrgFormDTO.java

@ -45,12 +45,16 @@ public class GetListPlaceOrgFormDTO implements Serializable {
private Boolean isPage = true; private Boolean isPage = true;
//页码 //页码
@Min(1) @Min(1)
private Integer pageNo; private Integer pageNo = 1;
//每页多少条 //每页多少条
private Integer pageSize = 20; private Integer pageSize = 20;
//token中客户Id //token中客户Id
private String customerId; private String customerId;
//场所Id //场所Id
private String placeOrgId; private String placeOrgId;
//token中userId
private String staffId;
//token中userId所属组织的pid
private String pids;
} }

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolRecordFormDTO.java

@ -43,12 +43,16 @@ public class GetListPlacePatrolRecordFormDTO implements Serializable {
private String finalResult; private String finalResult;
//页码 //页码
@Min(1) @Min(1)
private Integer pageNo; private Integer pageNo = 1;
//每页多少条 //每页多少条
private Integer pageSize = 20; private Integer pageSize = 20;
//token中客户Id //token中客户Id
private String customerId; private String customerId;
//巡查记录Id //巡查记录Id
private String placePatrolRecordId; private String placePatrolRecordId;
//token中userId
private String staffId;
//token中userId所属组织的pid
private String pids;
} }

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolReviewRecordFormDTO.java

@ -38,7 +38,7 @@ public class GetListPlacePatrolReviewRecordFormDTO implements Serializable {
private String placePatrolReviewRecordId; private String placePatrolReviewRecordId;
//页码 //页码
@Min(1) @Min(1)
private Integer pageNo; private Integer pageNo = 1;
//每页多少条 //每页多少条
private Integer pageSize = 20; private Integer pageSize = 20;
//token中客户Id //token中客户Id

6
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/GetListPlacePatrolTeamFormDTO.java

@ -43,12 +43,16 @@ public class GetListPlacePatrolTeamFormDTO implements Serializable {
private Boolean isPage = true; private Boolean isPage = true;
//页码 //页码
@Min(1) @Min(1)
private Integer pageNo; private Integer pageNo = 1;
//每页多少条 //每页多少条
private Integer pageSize = 20; private Integer pageSize = 20;
//token中客户Id //token中客户Id
private String customerId; private String customerId;
//场所Id //场所Id
private String teamId; private String teamId;
//token中userId
private String staffId;
//token中userId所属组织的pid
private String pids;
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlaceOrgResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.result;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -12,8 +13,8 @@ import java.util.List;
@Data @Data
public class GetListPlaceOrgResultDTO implements Serializable { public class GetListPlaceOrgResultDTO implements Serializable {
//集合总条数 //集合总条数
private Integer total; private Integer total = 0;
//社会组织信息 //社会组织信息
private List<PlaceOrgDetailResultDTO> list; private List<PlaceOrgDetailResultDTO> list = new ArrayList<>();
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolRecordResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.result;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -12,8 +13,8 @@ import java.util.List;
@Data @Data
public class GetListPlacePatrolRecordResultDTO implements Serializable { public class GetListPlacePatrolRecordResultDTO implements Serializable {
//集合总条数 //集合总条数
private Integer total; private Integer total = 0;
//社会组织信息 //社会组织信息
private List<PlacePatrolRecordDetailResultDTO> list; private List<PlacePatrolRecordDetailResultDTO> list = new ArrayList<>();
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolReviewRecordResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.result;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -12,8 +13,8 @@ import java.util.List;
@Data @Data
public class GetListPlacePatrolReviewRecordResultDTO implements Serializable { public class GetListPlacePatrolReviewRecordResultDTO implements Serializable {
//集合总条数 //集合总条数
private Integer total; private Integer total = 0;
//社会组织信息 //社会组织信息
private List<PlacePatrolReviewRecordDetailResultDTO> list; private List<PlacePatrolReviewRecordDetailResultDTO> list = new ArrayList<>();
} }

5
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/GetListPlacePatrolTeamResultDTO.java

@ -3,6 +3,7 @@ package com.epmet.dto.result;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -12,8 +13,8 @@ import java.util.List;
@Data @Data
public class GetListPlacePatrolTeamResultDTO implements Serializable { public class GetListPlacePatrolTeamResultDTO implements Serializable {
//集合总条数 //集合总条数
private Integer total; private Integer total = 0;
//社会组织信息 //社会组织信息
private List<PlacePatrolTeamDetailResultDTO> list; private List<PlacePatrolTeamDetailResultDTO> list = new ArrayList<>();
} }

2
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlaceOrgDetailResultDTO.java

@ -27,6 +27,8 @@ public class PlaceOrgDetailResultDTO implements Serializable {
private String ninePlaceName; private String ninePlaceName;
//场所规模【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】 //场所规模【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】
private String scale; private String scale;
//场所规模名称【 0:10人以下 1:10-20人 2:21-40人 3:41-100人 4:100人以上】
private String scaleName;
//负责人 //负责人
private String personInCharge; private String personInCharge;
//联系电话 //联系电话

3
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/PlacePatrolTeamDetailResultDTO.java

@ -4,6 +4,7 @@ import com.epmet.dto.IcPlacePatrolTeamStaffDTO;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
@ -33,6 +34,6 @@ public class PlacePatrolTeamDetailResultDTO implements Serializable {
//创建时间 //创建时间
private String time; private String time;
//分队成员信息 //分队成员信息
private List<IcPlacePatrolTeamStaffDTO> memberList; private List<IcPlacePatrolTeamStaffDTO> memberList = new ArrayList<>();
} }

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlaceOrgController.java

@ -99,6 +99,7 @@ public class IcPlaceOrgController {
@PostMapping("getlist") @PostMapping("getlist")
public Result<GetListPlaceOrgResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlaceOrgFormDTO formDTO) { public Result<GetListPlaceOrgResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlaceOrgFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<GetListPlaceOrgResultDTO>().ok(placeOrgService.getList(formDTO)); return new Result<GetListPlaceOrgResultDTO>().ok(placeOrgService.getList(formDTO));
} }

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolRecordController.java

@ -88,6 +88,7 @@ public class IcPlacePatrolRecordController {
@PostMapping("getlist") @PostMapping("getlist")
public Result<GetListPlacePatrolRecordResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolRecordFormDTO formDTO) { public Result<GetListPlacePatrolRecordResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolRecordFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<GetListPlacePatrolRecordResultDTO>().ok(placePatrolRecordService.getList(formDTO)); return new Result<GetListPlacePatrolRecordResultDTO>().ok(placePatrolRecordService.getList(formDTO));
} }

1
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/IcPlacePatrolTeamController.java

@ -101,6 +101,7 @@ public class IcPlacePatrolTeamController {
@PostMapping("getlist") @PostMapping("getlist")
public Result<GetListPlacePatrolTeamResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolTeamFormDTO formDTO) { public Result<GetListPlacePatrolTeamResultDTO> getList(@LoginUser TokenDto tokenDto, @RequestBody GetListPlacePatrolTeamFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setStaffId(tokenDto.getUserId());
return new Result<GetListPlacePatrolTeamResultDTO>().ok(placePatrolTeamService.getList(formDTO)); return new Result<GetListPlacePatrolTeamResultDTO>().ok(placePatrolTeamService.getList(formDTO));
} }

19
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlaceOrgServiceImpl.java

@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.dto.result.OptionResultDTO; import com.epmet.commons.tools.dto.result.OptionResultDTO;
import com.epmet.commons.tools.enums.DictTypeEnum;
import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
@ -44,6 +45,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 九小场所下组织管理 * 九小场所下组织管理
@ -114,6 +116,7 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac
return resultDTO; return resultDTO;
} }
resultDTO = result.get(0); resultDTO = result.get(0);
//2.查询九小场所信息 //2.查询九小场所信息
Result<List<OptionResultDTO>> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); Result<List<OptionResultDTO>> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption();
if (!result1.success()) { if (!result1.success()) {
@ -124,6 +127,11 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac
resultDTO.setNinePlaceName(d.getLabel()); resultDTO.setNinePlaceName(d.getLabel());
} }
} }
//3.查询人员规模字典表信息
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode());
resultDTO.setScaleName(unitTypeMap.getData().get(resultDTO.getScale()));
return resultDTO; return resultDTO;
} }
@ -134,6 +142,8 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac
@Override @Override
public GetListPlaceOrgResultDTO getList(GetListPlaceOrgFormDTO formDTO) { public GetListPlaceOrgResultDTO getList(GetListPlaceOrgFormDTO formDTO) {
GetListPlaceOrgResultDTO resultDTO = new GetListPlaceOrgResultDTO(); GetListPlaceOrgResultDTO resultDTO = new GetListPlaceOrgResultDTO();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setPids(staffInfoCache.getAgencyPIds());
//1.根据查询条件分页查询场所数据 //1.根据查询条件分页查询场所数据
PageInfo<PlaceOrgDetailResultDTO> result = PageInfo<PlaceOrgDetailResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO));
@ -141,14 +151,21 @@ public class IcPlaceOrgServiceImpl extends BaseServiceImpl<IcPlaceOrgDao, IcPlac
return resultDTO; return resultDTO;
} }
resultDTO.setTotal((int) result.getTotal()); resultDTO.setTotal((int) result.getTotal());
//2.查询九小场所信息 //2.查询九小场所信息
Result<List<OptionResultDTO>> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption(); Result<List<OptionResultDTO>> result1 = epmetAdminOpenFeignClient.getNineSmallPlacesOption();
if (!result1.success()) { if (!result1.success()) {
throw new RenException("获取九小场所基本信息失败......"); throw new RenException("获取九小场所基本信息失败......");
} }
result.getList().forEach(r -> result1.getData().stream().filter(u -> r.getNinePlaceVal().equals(u.getValue())).forEach(u -> r.setNinePlaceName(u.getLabel()))); result.getList().forEach(r -> result1.getData().stream().filter(u -> r.getNinePlaceVal().equals(u.getValue())).forEach(u -> r.setNinePlaceName(u.getLabel())));
resultDTO.setList(result.getList());
//3.人员规模字典表赋值
Result<Map<String, String>> unitTypeMap = epmetAdminOpenFeignClient.dictMap(DictTypeEnum.SCALE.getCode());
result.getList().forEach(item -> {
item.setScaleName(unitTypeMap.getData().get(item.getScale()));
});
resultDTO.setList(result.getList());
return resultDTO; return resultDTO;
} }
} }

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolRecordServiceImpl.java

@ -159,6 +159,8 @@ public class IcPlacePatrolRecordServiceImpl extends BaseServiceImpl<IcPlacePatro
@Override @Override
public GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO) { public GetListPlacePatrolRecordResultDTO getList(GetListPlacePatrolRecordFormDTO formDTO) {
GetListPlacePatrolRecordResultDTO resultDTO = new GetListPlacePatrolRecordResultDTO(); GetListPlacePatrolRecordResultDTO resultDTO = new GetListPlacePatrolRecordResultDTO();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setPids(staffInfoCache.getAgencyPIds());
//1.根据条件查询巡查记录数据 //1.根据条件查询巡查记录数据
PageInfo<PlacePatrolRecordDetailResultDTO> result = PageInfo<PlacePatrolRecordDetailResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO)); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.getList(formDTO));

28
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/IcPlacePatrolTeamServiceImpl.java

@ -48,7 +48,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -74,6 +76,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void add(AddPlacePatrolTeamFormDTO formDTO) { public void add(AddPlacePatrolTeamFormDTO formDTO) {
//检验分队下添加的人员手机号唯一
Map<String, String> map = new HashMap<>();
formDTO.getMemberList().forEach(m -> {
if(map.containsKey(m.getMobile())){
throw new RenException(String.format("新增巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile()));
}
map.put(m.getMobile(),m.getName());
});
//1.分队主表新增数据 //1.分队主表新增数据
IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class); IcPlacePatrolTeamEntity entity = ConvertUtils.sourceToTarget(formDTO, IcPlacePatrolTeamEntity.class);
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId()); CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
@ -101,6 +111,14 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void edit(EditPlacePatrolTeamFormDTO formDTO) { public void edit(EditPlacePatrolTeamFormDTO formDTO) {
//检验分队下添加的人员手机号唯一
Map<String, String> map = new HashMap<>();
formDTO.getMemberList().forEach(m -> {
if(map.containsKey(m.getMobile())){
throw new RenException(String.format("修改巡查人员管理失败,分队下人员手机号重复,重复手机号->%s", m.getMobile()));
}
map.put(m.getMobile(),m.getName());
});
//1.修改分队主表信息 //1.修改分队主表信息
IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId()); IcPlacePatrolTeamEntity entity = baseDao.selectById(formDTO.getTeamId());
if (null == entity) { if (null == entity) {
@ -176,7 +194,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
for (String str : resultDTO.getGridIds().split(",")) { for (String str : resultDTO.getGridIds().split(",")) {
gridList.forEach(r -> { gridList.forEach(r -> {
if (str.equals(r.getId())) { if (str.equals(r.getId())) {
gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName()); gridNames.append("".equals(gridNames.toString().trim()) ? r.getGridName() : "," + r.getGridName());
} }
}); });
} }
@ -186,7 +204,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
for (String str : resultDTO.getNinePlaceVals().split(",")) { for (String str : resultDTO.getNinePlaceVals().split(",")) {
nineList.getData().forEach(r -> { nineList.getData().forEach(r -> {
if (str.equals(r.getValue())) { if (str.equals(r.getValue())) {
ninePlaceNames.append("".equals(ninePlaceNames) ? r.getLabel() : "," + r.getLabel()); ninePlaceNames.append("".equals(ninePlaceNames.toString().trim()) ? r.getLabel() : "," + r.getLabel());
} }
}); });
} }
@ -202,6 +220,8 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
@Override @Override
public GetListPlacePatrolTeamResultDTO getList(GetListPlacePatrolTeamFormDTO formDTO) { public GetListPlacePatrolTeamResultDTO getList(GetListPlacePatrolTeamFormDTO formDTO) {
GetListPlacePatrolTeamResultDTO resultDTO = new GetListPlacePatrolTeamResultDTO(); GetListPlacePatrolTeamResultDTO resultDTO = new GetListPlacePatrolTeamResultDTO();
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
formDTO.setPids(staffInfoCache.getAgencyPIds());
//1.根据条件查询分队及成员数据 //1.根据条件查询分队及成员数据
PageInfo<PlacePatrolTeamDetailResultDTO> result = PageInfo<PlacePatrolTeamDetailResultDTO> result =
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO)); PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()).doSelectPageInfo(() -> baseDao.getList(formDTO));
@ -232,7 +252,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
for (String str : dto.getGridIds().split(",")) { for (String str : dto.getGridIds().split(",")) {
gridList.forEach(r -> { gridList.forEach(r -> {
if (str.equals(r.getId())) { if (str.equals(r.getId())) {
gridNames.append("".equals(gridNames) ? r.getGridName() : "," + r.getGridName()); gridNames.append("".equals(gridNames.toString().trim()) ? r.getGridName() : "," + r.getGridName());
} }
}); });
} }
@ -241,7 +261,7 @@ public class IcPlacePatrolTeamServiceImpl extends BaseServiceImpl<IcPlacePatrolT
for (String str : dto.getNinePlaceVals().split(",")) { for (String str : dto.getNinePlaceVals().split(",")) {
nineList.getData().forEach(r -> { nineList.getData().forEach(r -> {
if (str.equals(r.getValue())) { if (str.equals(r.getValue())) {
ninePlaceNames.append("".equals(ninePlaceNames) ? r.getLabel() : "," + r.getLabel()); ninePlaceNames.append("".equals(ninePlaceNames.toString().trim()) ? r.getLabel() : "," + r.getLabel());
} }
}); });
} }

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlaceOrgDao.xml

@ -25,6 +25,9 @@
<if test="customerId != null and customerId.trim() != ''"> <if test="customerId != null and customerId.trim() != ''">
AND a.customer_id = #{customerId} AND a.customer_id = #{customerId}
</if> </if>
<if test="pids != null and pids.trim() != ''">
AND a.pids LIKE CONCAT('%', #{pids}, '%')
</if>
<if test="gridId != null and gridId.trim() != ''"> <if test="gridId != null and gridId.trim() != ''">
AND a.grid_id = #{gridId} AND a.grid_id = #{gridId}
</if> </if>

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolRecordDao.xml

@ -34,6 +34,9 @@
<if test="customerId != null and customerId.trim() != ''"> <if test="customerId != null and customerId.trim() != ''">
AND a.customer_id = #{customerId} AND a.customer_id = #{customerId}
</if> </if>
<if test="pids != null and pids.trim() != ''">
AND a.pids LIKE CONCAT('%', #{pids}, '%')
</if>
<if test="gridId != null and gridId.trim() != ''"> <if test="gridId != null and gridId.trim() != ''">
AND a.grid_id = #{gridId} AND a.grid_id = #{gridId}
</if> </if>

3
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcPlacePatrolTeamDao.xml

@ -27,6 +27,9 @@
<if test="customerId != null and customerId.trim() != ''"> <if test="customerId != null and customerId.trim() != ''">
AND customer_id = #{customerId} AND customer_id = #{customerId}
</if> </if>
<if test="pids != null and pids.trim() != ''">
AND pids LIKE CONCAT('%', #{pids}, '%')
</if>
<if test="gridId != null and gridId.trim() != ''"> <if test="gridId != null and gridId.trim() != ''">
AND grid_ids LIKE CONCAT('%', #{gridId}, '%') AND grid_ids LIKE CONCAT('%', #{gridId}, '%')
</if> </if>

6
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/controller/IcPartymemberStyleController.java

@ -17,8 +17,10 @@
package com.epmet.modules.partymember.controller; package com.epmet.modules.partymember.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.commons.tools.validator.ValidatorUtils;
@ -64,10 +66,10 @@ public class IcPartymemberStyleController {
} }
@PostMapping("save") @PostMapping("save")
public Result save(@RequestBody IcPartymemberStyleDTO dto){ public Result save(@LoginUser TokenDto tokenDto, @RequestBody IcPartymemberStyleDTO dto){
//效验数据 //效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
icPartymemberStyleService.save(dto); icPartymemberStyleService.save(tokenDto, dto);
return new Result(); return new Result();
} }

3
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/IcPartymemberStyleService.java

@ -19,6 +19,7 @@ package com.epmet.modules.partymember.service;
import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity;
import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO; import com.epmet.resi.partymember.dto.partymember.IcPartymemberStyleDTO;
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO; import com.epmet.resi.partymember.dto.partymember.form.PartyMemberStyleFormDTO;
@ -72,7 +73,7 @@ public interface IcPartymemberStyleService extends BaseService<IcPartymemberStyl
* @author generator * @author generator
* @date 2021-11-18 * @date 2021-11-18
*/ */
void save(IcPartymemberStyleDTO dto); void save(TokenDto tokenDto, IcPartymemberStyleDTO dto);
/** /**
* 删除 * 删除

16
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/IcPartymemberStyleServiceImpl.java

@ -23,9 +23,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.redis.common.CustomerOrgRedis; import com.epmet.commons.tools.redis.common.CustomerOrgRedis;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.redis.common.bean.GridInfoCache; import com.epmet.commons.tools.redis.common.bean.GridInfoCache;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.modules.partymember.dao.IcPartymemberStyleDao; import com.epmet.modules.partymember.dao.IcPartymemberStyleDao;
import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity; import com.epmet.modules.partymember.entity.IcPartymemberStyleEntity;
@ -42,6 +45,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
@ -94,8 +98,11 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void save(IcPartymemberStyleDTO dto) { public void save(TokenDto tokenDto, IcPartymemberStyleDTO dto) {
IcPartymemberStyleEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleEntity.class); IcPartymemberStyleEntity entity = ConvertUtils.sourceToTarget(dto, IcPartymemberStyleEntity.class);
entity.setCustomerId(tokenDto.getCustomerId());
CustomerStaffInfoCacheResult staff = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId());
entity.setAgencyId(staff.getAgencyId());
if (StringUtils.isBlank(entity.getId())) { if (StringUtils.isBlank(entity.getId())) {
insert(entity); insert(entity);
} else { } else {
@ -108,9 +115,16 @@ public class IcPartymemberStyleServiceImpl extends BaseServiceImpl<IcPartymember
AtomicInteger i = new AtomicInteger(NumConstant.ZERO); AtomicInteger i = new AtomicInteger(NumConstant.ZERO);
List<IcPartymemberStyleImageEntity> list = dto.getImageList().stream().map(item -> { List<IcPartymemberStyleImageEntity> list = dto.getImageList().stream().map(item -> {
IcPartymemberStyleImageEntity e = new IcPartymemberStyleImageEntity(); IcPartymemberStyleImageEntity e = new IcPartymemberStyleImageEntity();
e.setCustomerId(tokenDto.getCustomerId());
e.setStyleId(entity.getId()); e.setStyleId(entity.getId());
e.setImageUrl(item); e.setImageUrl(item);
e.setSort(i.getAndIncrement()); e.setSort(i.getAndIncrement());
e.setRevision(NumConstant.ZERO);
e.setDelFlag(NumConstant.ZERO_STR);
e.setCreatedBy(tokenDto.getUserId());
e.setUpdatedBy(tokenDto.getUserId());
e.setCreatedTime(new Date());
e.setUpdatedTime(new Date());
return e; return e;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
icPartymemberStyleImageService.insertBatch(list); icPartymemberStyleImageService.insertBatch(list);

26
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GetByRealNamesFormDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Set;
/**
* @Author sun
* @Description 根据工作人员姓名批量查询基础信息数据
**/
@NoArgsConstructor
@Data
public class GetByRealNamesFormDTO implements Serializable {
private static final long serialVersionUID = -5220529162950147825L;
/**
* 客户Id
*/
private String customerId;
/**
* 工作人员姓名集合
*/
private Set<String> realNames;
}

7
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -653,4 +653,11 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/icresiuser/categorycount") @PostMapping("/epmetuser/icresiuser/categorycount")
Result<Map<String, Map<String, String>>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO); Result<Map<String, Map<String, String>>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO);
/**
* @Author sun
* @Description 根据工作人员姓名批量查询基础信息数据
**/
@PostMapping(value = "epmetuser/customerstaff/getbyrealnames")
Result<List<CustomerStaffDTO>> getByRealNames(@RequestBody GetByRealNamesFormDTO formDTO);
} }

5
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -474,4 +474,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
public Result<Map<String, Map<String, String>>> getHomeUserCategoryCount(IcResiUserDTO formDTO) { public Result<Map<String, Map<String, String>>> getHomeUserCategoryCount(IcResiUserDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeUserCategoryCount", formDTO); return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getHomeUserCategoryCount", formDTO);
} }
@Override
public Result<List<CustomerStaffDTO>> getByRealNames(GetByRealNamesFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getByRealNames", formDTO);
}
} }

9
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/CustomerStaffController.java

@ -446,5 +446,14 @@ public class CustomerStaffController {
return new Result(); return new Result();
} }
/**
* @Author sun
* @Description 根据工作人员姓名批量查询基础信息数据
**/
@PostMapping(value = "getbyrealnames")
public Result<List<CustomerStaffDTO>> getByRealNames(@RequestBody GetByRealNamesFormDTO formDTO) {
return new Result<List<CustomerStaffDTO>>().ok(customerStaffService.getByRealNames(formDTO));
}
} }

7
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -138,6 +138,7 @@ public class IcResiUserController {
IC_RESI_DOWNLOAD_DIR = exportDir; IC_RESI_DOWNLOAD_DIR = exportDir;
} }
@NoRepeatSubmit
@PostMapping("delete") @PostMapping("delete")
public Result delete(@LoginUser TokenDto tokenDto, @RequestBody DelIcResiUserFormDTO formDTO) { public Result delete(@LoginUser TokenDto tokenDto, @RequestBody DelIcResiUserFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId()); formDTO.setCustomerId(tokenDto.getCustomerId());
@ -159,6 +160,7 @@ public class IcResiUserController {
* @Author sun * @Author sun
* @Description 党建互联平台--保存居民信息 * @Description 党建互联平台--保存居民信息
**/ **/
@NoRepeatSubmit
@PostMapping("add") @PostMapping("add")
public Result add(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) { public Result add(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) {
String resiUserId = icResiUserService.add(tokenDto, formDTO); String resiUserId = icResiUserService.add(tokenDto, formDTO);
@ -177,6 +179,7 @@ public class IcResiUserController {
* @Author sun * @Author sun
* @Description 党建互联平台--修改居民信息 * @Description 党建互联平台--修改居民信息
**/ **/
@NoRepeatSubmit
@PostMapping("edit") @PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) { public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) {
String resiUserId = icResiUserService.edit(tokenDto, formDTO); String resiUserId = icResiUserService.edit(tokenDto, formDTO);
@ -238,8 +241,10 @@ public class IcResiUserController {
* @return void * @return void
* @author LiuJanJun * @author LiuJanJun
* @date 2021/11/19 4:24 下午 * @date 2021/11/19 4:24 下午
* @remark:分页批量导出 * @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx,
* 如果某个客户需要更新模版 则替换掉上面的模版文件然后 更新缓存里的值或者删除也行 再导出就会下载新的模版了
*/ */
@NoRepeatSubmit
@RequestMapping(value = "/exportExcel") @RequestMapping(value = "/exportExcel")
public void exportExcelByEasyExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception { public void exportExcelByEasyExcel(@RequestHeader String customerId,@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
//tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02"); //tokenDto.setUserId("9e37adcce6472152e6508a19d3683e02");

6
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/CustomerStaffDao.java

@ -215,4 +215,10 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
List<CustomerStaffDTO> listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List<String> userIds); List<CustomerStaffDTO> listDTOS(@Param("customerId") String customerId, @Param("realName") String realName, @Param("mobile") String mobile, @Param("userIds") List<String> userIds);
List<String> selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId); List<String> selectStaffRoles(@Param("userId") String userId,@Param("customerId") String customerId);
/**
* @Author sun
* @Description 根据工作人员姓名批量查询基础信息数据
**/
List<CustomerStaffDTO> getByRealNames(GetByRealNamesFormDTO formDTO);
} }

8
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java

@ -18,6 +18,7 @@
package com.epmet.dao; package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.IcResiUserDTO;
import com.epmet.dto.form.ResiUserQueryValueDTO; import com.epmet.dto.form.ResiUserQueryValueDTO;
import com.epmet.dto.result.DemandUserResDTO; import com.epmet.dto.result.DemandUserResDTO;
import com.epmet.dto.result.IcFormResColumnDTO; import com.epmet.dto.result.IcFormResColumnDTO;
@ -146,6 +147,11 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
Map<String,String> selectPersonType(@Param("columns")List<String> columns,@Param("customerId")String customerId, Map<String,String> selectPersonType(@Param("columns")List<String> columns,@Param("customerId")String customerId,
@Param("tableName")String tableName,@Param("userId")String userId); @Param("tableName")String tableName,@Param("userId")String userId);
/**
* @Author sun
* @Description 查询居民信息
**/
IcResiUserDTO getResiUser(IcResiUserDTO dto);
/** /**
* *
* @param agencyId * @param agencyId
@ -156,4 +162,4 @@ public interface IcResiUserDao extends BaseDao<IcResiUserEntity> {
List<DemandUserResDTO> selectDemandUsers(@Param("agencyId") String agencyId, List<DemandUserResDTO> selectDemandUsers(@Param("agencyId") String agencyId,
@Param("gridId")String gridId, @Param("gridId")String gridId,
@Param("name")String name); @Param("name")String name);
} }

6
epmet-user/epmet-user-server/src/main/java/com/epmet/service/CustomerStaffService.java

@ -335,4 +335,10 @@ public interface CustomerStaffService extends BaseService<CustomerStaffEntity> {
* @author sun * @author sun
*/ */
void enableStaff(EnableStaffFormDTO fromDTO); void enableStaff(EnableStaffFormDTO fromDTO);
/**
* @Author sun
* @Description 根据工作人员姓名批量查询基础信息数据
**/
List<CustomerStaffDTO> getByRealNames(GetByRealNamesFormDTO formDTO);
} }

9
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/CustomerStaffServiceImpl.java

@ -784,4 +784,13 @@ public class CustomerStaffServiceImpl extends BaseServiceImpl<CustomerStaffDao,
baseDao.updateById(staffEntity); baseDao.updateById(staffEntity);
} }
/**
* @Author sun
* @Description 根据工作人员姓名批量查询基础信息数据
**/
@Override
public List<CustomerStaffDTO> getByRealNames(GetByRealNamesFormDTO formDTO) {
return baseDao.getByRealNames(formDTO);
}
} }

23
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserImportServiceImpl.java

@ -29,6 +29,8 @@ import com.epmet.feign.EpmetAdminOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.IcResiUserImportService; import com.epmet.service.IcResiUserImportService;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
@ -59,6 +61,15 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
public static final ThreadLocal<Map<String, List<ErrorRow>>> errorRows = new ThreadLocal<>(); public static final ThreadLocal<Map<String, List<ErrorRow>>> errorRows = new ThreadLocal<>();
public static final ThreadLocal<Map<String, List<SkipedRow>>> skipedRows = new ThreadLocal<>(); public static final ThreadLocal<Map<String, List<SkipedRow>>> skipedRows = new ThreadLocal<>();
/**
* key: itemId
* value:
* key: option的中文
* value: options的英文key也可能是数据id
*/
Cache<String, Map<String, String>> itemIdAndOptionsCache = CacheBuilder.newBuilder().maximumSize(500).build();
@Autowired @Autowired
private LoginUserUtil loginUserUtil; private LoginUserUtil loginUserUtil;
@ -212,6 +223,7 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
} finally { } finally {
skipedRows.remove(); skipedRows.remove();
errorRows.remove(); errorRows.remove();
itemIdAndOptionsCache.invalidateAll();
} }
} }
@ -562,10 +574,13 @@ public class IcResiUserImportServiceImpl implements IcResiUserImportService, Res
String colValue = options.get(cellContent); String colValue = options.get(cellContent);
columnWrapper.setColValue(colValue); columnWrapper.setColValue(colValue);
} else { } else {
// remote类型 // remote类型。优先从缓存取
Map<String, String> optionsOfItem = itemIdAndOptionsCache.getIfPresent(columnWrapperEntry.getKey());
Map<String, String> options = listRemoteOptions(headerColumnWrapper, columnWrapper.getOptionSourceValue(), currUserAgencyId, "saveorupdate"); if (optionsOfItem == null || optionsOfItem.size() == 0) {
String colValue = options.get(cellContent); optionsOfItem = listRemoteOptions(headerColumnWrapper, columnWrapper.getOptionSourceValue(), currUserAgencyId, "saveorupdate");
itemIdAndOptionsCache.put(columnWrapperEntry.getKey(), optionsOfItem);
}
String colValue = optionsOfItem.get(cellContent);
columnWrapper.setColValue(colValue); columnWrapper.setColValue(colValue);
} }
} else if ("checkbox".equals(columnWrapper.getItemType())) { } else if ("checkbox".equals(columnWrapper.getItemType())) {

27
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -49,10 +49,7 @@ import com.epmet.constant.IcResiUserConstant;
import com.epmet.constant.SystemMessageType; import com.epmet.constant.SystemMessageType;
import com.epmet.constant.UserConstant; import com.epmet.constant.UserConstant;
import com.epmet.dao.IcResiUserDao; import com.epmet.dao.IcResiUserDao;
import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.*;
import com.epmet.dto.IcHouseDTO;
import com.epmet.dto.IcNeighborHoodDTO;
import com.epmet.dto.IcResiCategoryStatsConfigDTO;
import com.epmet.dto.form.*; import com.epmet.dto.form.*;
import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO; import com.epmet.dto.form.demand.UserDemandNameQueryFormDTO;
import com.epmet.dto.result.*; import com.epmet.dto.result.*;
@ -169,6 +166,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if(!map.containsKey("AGENCY_ID")){ if(!map.containsKey("AGENCY_ID")){
throw new RenException("新增居民信息--入参AGENCY_ID为空"); throw new RenException("新增居民信息--入参AGENCY_ID为空");
} }
//2021.11.25 新增需求 客户下身份证号唯一 start
if (map.containsKey("ID_CARD")) {
IcResiUserDTO dto = new IcResiUserDTO();
dto.setCustomerId(tokenDto.getCustomerId());
dto.setIdCard(map.get("ID_CARD"));
IcResiUserDTO userDTO = baseDao.getResiUser(dto);
if (null != userDTO && null != userDTO.getIdCard()) {
throw new RenException("新增居民信息失败,身份证号已存在!");
}
}
//2021.11.25 end
//查询组织信息 //查询组织信息
String agencyId = map.get("AGENCY_ID"); String agencyId = map.get("AGENCY_ID");
Result<CustomerAgencyDTO> result = govOrgOpenFeignClient.getAgencyById(agencyId); Result<CustomerAgencyDTO> result = govOrgOpenFeignClient.getAgencyById(agencyId);
@ -216,6 +224,17 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
if (!map.containsKey("ID")) { if (!map.containsKey("ID")) {
throw new RenException(String.format("居民信息修改-居民信息表主键值为空")); throw new RenException(String.format("居民信息修改-居民信息表主键值为空"));
} }
//2021.11.25 新增需求 客户下身份证号唯一 start
if (map.containsKey("ID_CARD")) {
IcResiUserDTO dto = new IcResiUserDTO();
dto.setCustomerId(tokenDto.getCustomerId());
dto.setIdCard(map.get("ID_CARD"));
IcResiUserDTO userDTO = baseDao.getResiUser(dto);
if (null != userDTO && null != userDTO.getIdCard()) {
throw new RenException("修改居民信息失败,身份证号已存在!");
}
}
//2021.11.25 end
resiUserId = map.get("ID"); resiUserId = map.get("ID");
} }
} }

26
epmet-user/epmet-user-server/src/main/resources/mapper/CustomerStaffDao.xml

@ -426,4 +426,30 @@
and sr.STAFF_ID=#{userId} and sr.STAFF_ID=#{userId}
) )
</select> </select>
<select id="getByRealNames" resultType="com.epmet.dto.CustomerStaffDTO">
SELECT
id,
customer_id,
user_id,
real_name,
gender,
email,
mobile,
address,
work_type,
head_photo,
active_flag,
active_time,
enable_flag
FROM
customer_staff
WHERE
del_flag = '0'
AND customer_id = #{customerId}
<foreach collection="realNames" item="name" open="AND real_name IN (" separator="," close=")">
#{name}
</foreach>
</select>
</mapper> </mapper>

13
epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml

@ -271,6 +271,19 @@
AND IC_RESI_USER = #{userId} AND IC_RESI_USER = #{userId}
</if> </if>
</select> </select>
<select id="getResiUser" resultType="com.epmet.dto.IcResiUserDTO">
SELECT
id,
`name`,
id_card,
mobile
FROM
ic_resi_user
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND id_card = #{idCard}
</select>
<select id="selectDemandUsers" parameterType="map" resultType="com.epmet.dto.result.DemandUserResDTO"> <select id="selectDemandUsers" parameterType="map" resultType="com.epmet.dto.result.DemandUserResDTO">

Loading…
Cancel
Save