日照智慧社区接口服务
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

469 lines
23 KiB

4 years ago
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
4 years ago
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.entity.TemplateExportParams;
4 years ago
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.enums.WriteDirectionEnum;
4 years ago
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
4 years ago
import com.alibaba.excel.write.metadata.fill.FillWrapper;
4 years ago
import com.alibaba.fastjson.JSON;
4 years ago
import com.epmet.commons.tools.annotation.LoginUser;
4 years ago
import com.epmet.commons.tools.aop.NoRepeatSubmit;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
4 years ago
import com.epmet.commons.tools.page.PageData;
4 years ago
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
4 years ago
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.IcResiUserDTO;
4 years ago
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.OperCustomizeOpenFeignClient;
import com.epmet.service.IcResiUserImportService;
4 years ago
import com.epmet.service.IcResiUserService;
4 years ago
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.IOUtils;
4 years ago
import org.apache.commons.lang3.StringUtils;
4 years ago
import org.apache.poi.ss.usermodel.Workbook;
4 years ago
import org.jetbrains.annotations.NotNull;
4 years ago
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
4 years ago
import javax.servlet.http.HttpServletResponse;
import java.io.FileOutputStream;
4 years ago
import java.io.IOException;
4 years ago
import java.io.OutputStream;
4 years ago
import java.net.URLEncoder;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
4 years ago
import java.util.concurrent.atomic.AtomicInteger;
4 years ago
/**
* 用户基础信息
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-10-26
*/
4 years ago
@Slf4j
4 years ago
@RestController
@RequestMapping("icresiuser")
public class IcResiUserController {
private static final String BASE_TABLE_NAME = "ic_resi_user";
private Path IC_RESI_UPLOAD_DIR;
@Autowired
private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient;
4 years ago
@Autowired
private IcResiUserService icResiUserService;
@Autowired
private IcResiUserImportService icResiUserImportService;
{
// 初始化上传目录
String home = System.getProperty("user.home");
Path importDir = Paths.get(home, "epmet_files", "ic_user_import");
if (Files.notExists(importDir)) {
try {
Files.createDirectories(importDir);
} catch (IOException e) {
log.error("创建数字赋能平台上传目录失败");
}
}
IC_RESI_UPLOAD_DIR = importDir;
}
4 years ago
@PostMapping("delete")
public Result delete(@LoginUser TokenDto tokenDto,@RequestBody DelIcResiUserFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO,DelIcResiUserFormDTO.IdGroup.class);
icResiUserService.delete(formDTO);
return new Result();
}
4 years ago
/**
* @Author sun
* @Description 党建互联平台--保存居民信息
**/
@PostMapping("add")
4 years ago
public Result add(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) {
icResiUserService.add(tokenDto, formDTO);
4 years ago
return new Result();
}
/**
* @Author sun
* @Description 党建互联平台--修改居民信息
**/
@PostMapping("edit")
4 years ago
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List<IcResiUserFormDTO> formDTO) {
icResiUserService.edit(tokenDto, formDTO);
4 years ago
return new Result();
}
/**
* @Description 根据房间号查人
* @Param formDTO
* @Return {@link Result<List<HomeUserResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/11/1 11:04
*/
@PostMapping("getpeoplebyroom")
public Result<List<HomeUserResultDTO>> getPeopleByRoom(@RequestBody IcResiUserDTO formDTO) {
return new Result<List<HomeUserResultDTO>>().ok(icResiUserService.getPeopleByRoom(formDTO.getHomeId()));
}
4 years ago
@PostMapping("listresi")
public Result<PageData<Map<String, Object>>> queryListResi1(@LoginUser TokenDto tokenDto, @RequestBody IcResiUserPageFormDTO pageFormDTO) {
4 years ago
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
pageFormDTO.setCustomerId(tokenDto.getCustomerId());
pageFormDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(pageFormDTO, IcResiUserPageFormDTO.AddUserInternalGroup.class);
return new Result<PageData<Map<String, Object>>>().ok(icResiUserService.pageResiMap(pageFormDTO));
4 years ago
}
4 years ago
/**
* 编辑页面显示居民信息详情
*
* @param pageFormDTO
* @return com.epmet.commons.tools.utils.Result
4 years ago
* @author yinzuomei
* @date 2021/10/28 10:29 上午
*/
@PostMapping("detail")
public Result queryIcResiDetail(@LoginUser TokenDto tokenDto, @RequestBody IcResiDetailFormDTO pageFormDTO) {
4 years ago
//pageFormDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
pageFormDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(pageFormDTO, IcResiDetailFormDTO.AddUserInternalGroup.class);
4 years ago
return new Result().ok(icResiUserService.queryIcResiDetail(pageFormDTO));
}
4 years ago
/**
* desc :备用 easypoi
* @param customerId
* @param pageFormDTO
* @param response
* @throws Exception
*/
@RequestMapping(value = "/exportExcel2")
4 years ago
public void exportExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
pageFormDTO.setCustomerId(customerId);
4 years ago
pageFormDTO.setPageFlag(false);
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
4 years ago
4 years ago
Map<String, Map<String, FormItem>> otherSheetItems = new HashMap<>();
//主表的
for (FormItem formItem : resiFormItems.getItemList()) {
if (StringUtils.isBlank(formItem.getColumnName())) {
continue;
}
4 years ago
Map<String, FormItem> itemMap = otherSheetItems.getOrDefault(formItem.getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(formItem.getTableName(), itemMap);
if (formItem.getItemType().equals("checkbox") || formItem.getItemType().equals("select") || formItem.getItemType().equals("radio")) {
itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem);
}
if (formItem.getChildGroup() != null) {
itemMap = otherSheetItems.getOrDefault(formItem.getChildGroup().getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(formItem.getChildGroup().getTableName(), itemMap);
for (FormItem2 item2 : formItem.getChildGroup().getItemList()) {
if (StringUtils.isBlank(item2.getColumnName())) {
continue;
}
4 years ago
if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) {
itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItem.class));
}
}
}
}
4 years ago
//其他sheet
for (FormGroupDTO groupItem : resiFormItems.getGroupList()) {
4 years ago
if (groupItem.getItemList() == null) {
continue;
}
Map<String, FormItem> itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap);
4 years ago
for (FormItem2 formItem2 : groupItem.getItemList()) {
if (StringUtils.isBlank(formItem2.getColumnName())) {
continue;
}
if ("checkbox".equals(formItem2.getItemType()) || "select".equals(formItem2.getItemType()) || "radio".equals(formItem2.getItemType())) {
4 years ago
itemMap.put(formItem2.getColumnName().concat(formItem2.getColumnNum() == 0 ? "" : formItem2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItem2, FormItem.class));
}
}
}
4 years ago
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
//resiMainList = (List<Map<String, Object>>)JSON.parse("[{\"IS_BDHJ\":\"1\",\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest2\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":null,\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":null,\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":null,\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"},{\"IS_SPECIAL\":\"1\",\"IS_XFRY\":\"0\",\"REMARKS\":\"beizhu\",\"IS_PARTY\":\"1\",\"icResiUserId\":\"yzmtest\",\"HOME_ID\":\"中海国际社区一里城1号楼1单元101\",\"HOUSE_TYPE\":\"平房\",\"UNIT_NAME\":\"1单元\",\"GRID_ID\":\"市北区-市北区第三网格3\",\"IS_DB\":\"0\",\"GENDER\":\"男\",\"BIRTHDAY\":\"2021-10-04\",\"IS_VETERANS\":\"0\",\"IS_MB\":\"0\",\"IS_UNEMPLOYED\":\"0\",\"DEMAND_NAME\":\"心理咨询\",\"IS_KC\":\"0\",\"IS_ENSURE_HOUSE\":\"0\",\"IS_SD\":\"0\",\"NAME\":\"尹作梅\",\"RDSJ\":\"2021-10-28 00:00:00\",\"IS_VOLUNTEER\":\"1\",\"GRID_ID_VALUE\":\"e74829ffc43d5470eba6b5e060c11e63\",\"IS_SZ\":\"0\",\"IS_CJ\":\"0\",\"HOME_ID_VALUE\":\"200\",\"DEMAND_CATEGORY_IDS\":\"10180002\",\"VILLAGE_NAME\":\"中海国际社区一里城\",\"IS_DBH\":\"0\",\"IS_SN\":\"0\",\"BUILD_NAME\":\"1号楼\",\"IS_YLFN\":\"0\",\"IS_UNITED_FRONT\":\"0\",\"ID_CARD\":\"371325199310260529\",\"MOBILE\":\"15764229697\",\"IS_OLD_PEOPLE\":\"0\",\"DOOR_NAME\":\"101\"}]");
log.info("resiMainList:{}", JSON.toJSONString(resiMainList));
4 years ago
String templatePath = "excel/ic_resi_info_cid.xls";
TemplateExportParams params = new TemplateExportParams(templatePath, true);
4 years ago
Map<Integer, Map<String, Object>> sheetMap = new HashMap<>();
4 years ago
Map<String, Object> mapData = new HashMap<>();
mapData.put("list", resiMainList.values());
System.out.println("===resiMainList==="+" "+JSON.toJSONString(resiMainList.values()));
sheetMap.put(0, mapData);
4 years ago
AtomicInteger n = new AtomicInteger();
for (FormItem item : resiFormItems.getItemList()) {
if (item.getChildGroup() != null) {
4 years ago
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
4 years ago
Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
4 years ago
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
Map<String, Object> mapData2 = new HashMap<>();
mapData2.put("list", resiChildMap.values());
System.out.println("===resiChildMap==="+item.getChildGroup().getTableName()+" "+JSON.toJSONString(resiChildMap.values()));
sheetMap.put(n.incrementAndGet(), mapData2);
4 years ago
}
}
}
4 years ago
4 years ago
Workbook workbook = ExcelExportUtil.exportExcel(sheetMap, params);
workbook.setActiveSheet(0);
4 years ago
workbook.write(getOutputStream("居民基本信息.xls",response));
4 years ago
}
@RequestMapping(value = "/exportExcel")
4 years ago
public void exportExcelByEasyExcel(@RequestHeader String customerId, @RequestBody IcResiUserPageFormDTO pageFormDTO, HttpServletResponse response) throws Exception {
pageFormDTO.setCustomerId(customerId);
pageFormDTO.setPageFlag(false);
CustomerFormResultDTO resiFormItems = getResiFormItems(pageFormDTO.getCustomerId());
Map<String, Map<String, FormItem>> otherSheetItems = new HashMap<>();
//主表的
for (FormItem formItem : resiFormItems.getItemList()) {
if (StringUtils.isBlank(formItem.getColumnName())) {
continue;
}
Map<String, FormItem> itemMap = otherSheetItems.getOrDefault(formItem.getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(formItem.getTableName(), itemMap);
if (formItem.getItemType().equals("checkbox") || formItem.getItemType().equals("select") || formItem.getItemType().equals("radio")) {
itemMap.put(formItem.getColumnName().concat(formItem.getColumnNum() == 0 ? "" : formItem.getColumnNum().toString()), formItem);
}
if (formItem.getChildGroup() != null) {
itemMap = otherSheetItems.getOrDefault(formItem.getChildGroup().getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(formItem.getChildGroup().getTableName(), itemMap);
for (FormItem2 item2 : formItem.getChildGroup().getItemList()) {
if (StringUtils.isBlank(item2.getColumnName())) {
continue;
}
if ("checkbox".equals(item2.getItemType()) || "select".equals(item2.getItemType()) || "radio".equals(item2.getItemType())) {
itemMap.put(item2.getColumnName().concat(item2.getColumnNum() == 0 ? "" : item2.getColumnNum().toString()), ConvertUtils.sourceToTarget(item2, FormItem.class));
}
}
}
}
//其他sheet
for (FormGroupDTO groupItem : resiFormItems.getGroupList()) {
if (groupItem.getItemList() == null) {
continue;
}
Map<String, FormItem> itemMap = otherSheetItems.getOrDefault(groupItem.getTableName(), new HashMap<>());
otherSheetItems.putIfAbsent(groupItem.getTableName(), itemMap);
for (FormItem2 formItem2 : groupItem.getItemList()) {
if (StringUtils.isBlank(formItem2.getColumnName())) {
continue;
}
if ("checkbox".equals(formItem2.getItemType()) || "select".equals(formItem2.getItemType()) || "radio".equals(formItem2.getItemType())) {
itemMap.put(formItem2.getColumnName().concat(formItem2.getColumnNum() == 0 ? "" : formItem2.getColumnNum().toString()), ConvertUtils.sourceToTarget(formItem2, FormItem.class));
}
}
}
Map<String, Map<String, Object>> resiMainList = icResiUserService.getDataForExport(otherSheetItems.get(BASE_TABLE_NAME),new HashMap<>(), pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), BASE_TABLE_NAME, pageFormDTO.getConditions());
//=========================================
4 years ago
String fileName = "居民基本信息.xls";
String templatePath = this.getClass().getResource("/excel/ic_resi_info_cid_for_easy_excel.xls").getPath();
//InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(templatePath);
ExcelWriter excelWriter = EasyExcel.write(getOutputStream(fileName,response)).withTemplate(templatePath).build();
FillConfig fillConfig = FillConfig.builder().direction(WriteDirectionEnum.VERTICAL).build();
4 years ago
WriteSheet fistSheet = EasyExcel.writerSheet(NumConstant.ZERO).build();
System.out.println("===resiMainList==="+" "+JSON.toJSONString(resiMainList.values()));
excelWriter.fill(new FillWrapper("t1", resiMainList.values()),fillConfig, fistSheet);
4 years ago
4 years ago
//=======================================
4 years ago
AtomicInteger n = new AtomicInteger();
for (FormItem item : resiFormItems.getItemList()) {
if (item.getChildGroup() != null) {
if (!item.getChildGroup().getTableName().equals(BASE_TABLE_NAME)) {
Map<String, FormItem> itemMap1 = otherSheetItems.get(item.getChildGroup().getTableName());
Map<String, Map<String, Object>> resiChildMap = icResiUserService.getDataForExport(itemMap1,resiMainList, pageFormDTO.getCustomerId(), pageFormDTO.getFormCode(), item.getChildGroup().getTableName(), pageFormDTO.getConditions());
//resiChildMap.forEach((key, value) -> value.putAll(resiMainList.get(key)));
4 years ago
int sheetNo = n.incrementAndGet();
WriteSheet writeSheet = EasyExcel.writerSheet(sheetNo).build();
System.out.println("===resiChildMap==="+item.getChildGroup().getTableName()+" "+JSON.toJSONString(resiChildMap.values()));
4 years ago
excelWriter.fill(new FillWrapper("t"+(sheetNo+1), resiChildMap.values()), writeSheet);
}
}
}
excelWriter.finish();
}
private static OutputStream getOutputStream(String fileName, HttpServletResponse response) throws Exception {
fileName = URLEncoder.encode(fileName, "UTF-8");
response.setContentType("application/vnd.ms-excel");
response.setCharacterEncoding("utf8");
4 years ago
response.setHeader("Content-Disposition", "attachment;filename=" + fileName);
4 years ago
response.addHeader("Access-Control-Expose-Headers", "Content-disposition");
return response.getOutputStream();
}
/**
* excel导入居民基本信息
*
* @return
*/
4 years ago
@NoRepeatSubmit
4 years ago
@PostMapping("importExcel")
public void importExcelByEasyExcel(@RequestPart("file") MultipartFile file, HttpServletResponse response) {
if (file.isEmpty()) {
throw new RenException("请上传文件");
}
// 校验文件类型
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
if (!"xls".equals(extension) && !"xlsx".equals(extension)) {
throw new RenException("文件类型不匹配");
}
Path savePath = null;
try {
String fileName = UUID.randomUUID().toString().concat(".").concat(extension);
savePath = IC_RESI_UPLOAD_DIR.resolve(fileName);
IOUtils.copy(file.getInputStream(), new FileOutputStream(savePath.toString()));
icResiUserImportService.importIcResiInfoFromExcel(savePath.toString(), response);
} catch (IOException e) {
String errorMsg = ExceptionUtils.getErrorStackTrace(e);
log.error("【导入居民信息失败】导入失败:{}", errorMsg);
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} finally {
try {
Files.delete(savePath);
} catch (IOException e) {
log.error("【导入居民信息失败】清理上传的文件失败:{}", ExceptionUtils.getErrorStackTrace(e));
}
}
}
4 years ago
@PostMapping("test")
public Result<List<Map<String, Object>>> test(@RequestBody DynamicQueryFormDTO formDTO) {
formDTO.setCustomerId("45687aa479955f9d06204d415238f7cc");
//formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<Map<String, Object>>>().ok(icResiUserService.dynamicQuery(formDTO.getCustomerId(),
4 years ago
formDTO.getFormCode(),
formDTO.getResultTableName(),
formDTO.getConditions()));
}
4 years ago
/**
* @param formDTO
* @Description 查询个人数据
4 years ago
* @author zxc
* @date 2021/11/3 9:21 上午
*/
@PostMapping("persondata")
public Result<PersonDataResultDTO> personData(@RequestBody PersonDataFormDTO formDTO) {
4 years ago
return new Result<PersonDataResultDTO>().ok(icResiUserService.personData(formDTO));
}
/**
* @param formDTO
* @param tokenDto
* @Description 根据名字搜索
4 years ago
* @author zxc
* @date 2021/11/3 1:42 下午
*/
@PostMapping("searchbyname")
public Result<List<SearchByNameResultDTO>> searchByName(@RequestBody SearchByNameFormDTO formDTO, @LoginUser TokenDto tokenDto) {
4 years ago
ValidatorUtils.validateEntity(formDTO, SearchByNameFormDTO.SearchByNameForm.class);
return new Result<List<SearchByNameResultDTO>>().ok(icResiUserService.searchByName(formDTO, tokenDto));
}
@NotNull
private CustomerFormResultDTO getResiFormItems(String customerId) {
CustomerFormQueryDTO queryDTO = new CustomerFormQueryDTO();
queryDTO.setFormCode("resi_base_info");
queryDTO.setCustomerId(customerId);
Result<CustomerFormResultDTO> resultForm = operCustomizeOpenFeignClient.getCustomerForm(queryDTO);
if (resultForm == null || !resultForm.success() || resultForm.getData() == null) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
System.out.println(JSON.toJSONString(resultForm.getData()));
return resultForm.getData();
4 years ago
}
/**
* @Description 个人信息-家庭关系
* @Param formDTO
* @Return {@link Result< OwnerRelationResultDTO>}
* @Author zhaoqifeng
* @Date 2021/11/5 11:13
*/
@PostMapping("ownerrelation")
public Result<OwnerRelationResultDTO> getOwnerRelation(@RequestBody PersonDataFormDTO formDTO) {
return new Result<OwnerRelationResultDTO>().ok(icResiUserService.getOwnerRelation(formDTO.getUserId()));
}
/**
* @Description 获取一栋楼每个房间人员分类的数量
* @Param formDTO
* @Return {@link Result< Map< String, Map< String, String>>>}
* @Author zhaoqifeng
* @Date 2021/11/5 15:10
*/
@PostMapping("categorycount")
public Result<Map<String, Map<String, String>>> getHomeUserCategoryCount(@RequestBody IcResiUserDTO formDTO) {
return new Result<Map<String, Map<String, String>>>().ok(icResiUserService.getHomeUserCategoryCount(formDTO.getBuildId()));
}
}