+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.controller;
+
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ExcelUtils;
+import com.epmet.commons.tools.utils.Result;
+import com.epmet.commons.tools.validator.AssertUtils;
+import com.epmet.commons.tools.validator.ValidatorUtils;
+import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.commons.tools.validator.group.DefaultGroup;
+import com.epmet.commons.tools.validator.group.UpdateGroup;
+import com.epmet.dto.IcResiUserAttachmentDTO;
+import com.epmet.excel.ProjectProcessAttachmentExcel;
+import com.epmet.service.IcResiUserAttachmentService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+
+/**
+ * 项目节点附件表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-12-21
+ */
+@RestController
+@RequestMapping("icresiuserattachment")
+public class IcResiUserAttachmentController {
+
+ @Autowired
+ private IcResiUserAttachmentService icResiUserAttachmentService;
+
+ @GetMapping("page")
+ public Result> page(@RequestParam Map params){
+ PageData page = icResiUserAttachmentService.page(params);
+ return new Result>().ok(page);
+ }
+
+ @GetMapping("{id}")
+ public Result get(@PathVariable("id") String id){
+ IcResiUserAttachmentDTO data = icResiUserAttachmentService.get(id);
+ return new Result().ok(data);
+ }
+
+ @PostMapping
+ public Result save(@RequestBody IcResiUserAttachmentDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
+ icResiUserAttachmentService.save(dto);
+ return new Result();
+ }
+
+ @PutMapping
+ public Result update(@RequestBody IcResiUserAttachmentDTO dto){
+ //效验数据
+ ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
+ icResiUserAttachmentService.update(dto);
+ return new Result();
+ }
+
+ @DeleteMapping
+ public Result delete(@RequestBody String[] ids){
+ //效验数据
+ AssertUtils.isArrayEmpty(ids, "id");
+ icResiUserAttachmentService.delete(ids);
+ return new Result();
+ }
+
+ @GetMapping("export")
+ public void export(@RequestParam Map params, HttpServletResponse response) throws Exception {
+ List list = icResiUserAttachmentService.list(params);
+ ExcelUtils.exportExcelToTarget(response, null, list, ProjectProcessAttachmentExcel.class);
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
index 5a44547fc8..4576a0d599 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
@@ -229,16 +229,51 @@ public class IcResiUserController implements ResultDataResolver {
@PostMapping("edit")
public Result edit(@LoginUser TokenDto tokenDto, @RequestBody List formDTO) {
String resiUserId = icResiUserService.edit(tokenDto, formDTO);
+ //推送MQ事件
+ editResiMq(tokenDto.getCustomerId(), resiUserId);
+ return new Result();
+ }
+
+ /**
+ * 租客房东根据身份证更新头像
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhy
+ * @date 2022/4/26 10:48
+ */
+ @PostMapping("rent/rentUpdate")
+ public Result rentUpdate(@RequestBody RentTenantFormDTO formDTO) {
+ String resiUserId = icResiUserService.rentUpdate(formDTO);
+ //推送MQ事件
+ editResiMq(formDTO.getCustomerId(), resiUserId);
+ return new Result();
+ }
+
+ private void editResiMq(String customerId, String userId) {
//推送MQ事件
IcResiUserAddMQMsg mqMsg = new IcResiUserAddMQMsg();
- mqMsg.setCustomerId(tokenDto.getCustomerId());
- log.info("customer id is {}",tokenDto.getCustomerId());
- mqMsg.setIcResiUser(resiUserId);
+ mqMsg.setCustomerId(customerId);
+ log.info("customer id is {}", customerId);
+ mqMsg.setIcResiUser(userId);
SystemMsgFormDTO form = new SystemMsgFormDTO();
form.setMessageType(SystemMessageType.IC_RESI_USER_EDIT);
form.setContent(mqMsg);
epmetMessageOpenFeignClient.sendSystemMsgByMQ(form);
- return new Result();
+ }
+
+ /**
+ * 租客房东黑名单查询个人数据
+ *
+ * @param formDTO
+ * @return com.epmet.commons.tools.utils.Result
+ * @author zhy
+ * @date 2022/4/26 15:51
+ */
+ @PostMapping("rent/tenantData")
+ public Result tenantData(@RequestBody RentTenantDataFormDTO formDTO) {
+ ValidatorUtils.validateEntity(formDTO, RentTenantDataFormDTO.class);
+ return new Result().ok(icResiUserService.tenantData(formDTO));
}
/**
@@ -255,12 +290,13 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 根据ic_resi_user找家属
+ *
* @param icResiUserId
* @return
*/
@GetMapping("findfamilymem/{icResiUserId}")
- public Result findFamilyMem(@PathVariable("icResiUserId") String icResiUserId){
- if(StringUtils.isNotBlank(icResiUserId)){
+ public Result findFamilyMem(@PathVariable("icResiUserId") String icResiUserId) {
+ if (StringUtils.isNotBlank(icResiUserId)) {
return new Result().ok(icResiUserService.findFamilyMem(icResiUserId));
}
return new Result<>();
@@ -272,7 +308,7 @@ public class IcResiUserController implements ResultDataResolver {
pageFormDTO.setCustomerId(tokenDto.getCustomerId());
pageFormDTO.setStaffId(tokenDto.getUserId());
ValidatorUtils.validateEntity(pageFormDTO, IcResiUserPageFormDTO.AddUserInternalGroup.class);
- if(null==pageFormDTO.getConditions()){
+ if (null == pageFormDTO.getConditions()) {
pageFormDTO.setConditions(new ArrayList<>());
}
return new Result>>().ok(icResiUserService.pageResiMap(pageFormDTO));
@@ -304,12 +340,12 @@ public class IcResiUserController implements ResultDataResolver {
* @return void
* @author LiuJanJun
* @date 2021/11/19 4:24 下午
- * @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx,
+ * @remark:分页批量导出 oss目录在 各个环境对应的前缀文件夹/file-template/resi-template/客户ID.xlsx,
* 如果某个客户需要更新模版 则替换掉上面的模版文件;然后 更新缓存里的值或者删除也行 再导出就会下载新的模版了
*/
@NoRepeatSubmit
@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");
long startM = System.currentTimeMillis();
CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(customerId, tokenDto.getUserId());
@@ -335,23 +371,23 @@ public class IcResiUserController implements ResultDataResolver {
List resiFormAllItems = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode());
Map allItemMap = resiFormAllItems.stream().collect(Collectors.toMap(FormItemResult::getItemId, o -> o));
Map map = new HashMap<>();
- allItemMap.values().forEach(item->{
+ allItemMap.values().forEach(item -> {
String tableName = item.getTableName();
ExportResiUserItemDTO exportItem = map.getOrDefault(tableName, new ExportResiUserItemDTO());
- map.putIfAbsent(tableName,exportItem);
+ map.putIfAbsent(tableName, exportItem);
String columnName = item.getColumnName().concat(item.getColumnNum() == NumConstant.ZERO ? StrConstant.EPMETY_STR : item.getColumnNum().toString());
- exportItem.getItemMap().put(columnName,item);
- if (Constant.OPITON_SOURCE_REMOTE.equals(item.getOptionSourceType())&&item.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)){
+ exportItem.getItemMap().put(columnName, item);
+ if (Constant.OPITON_SOURCE_REMOTE.equals(item.getOptionSourceType()) && item.getOptionSourceValue().contains(StrConstant.QUESTION_MARK)) {
//多个参数
String[] paramArr = item.getOptionSourceValue().split(StrConstant.QUESTION_MARK_TRANSFER)[NumConstant.ONE].split(StrConstant.AND_MARK);
- Arrays.stream(paramArr).forEach(o->{
+ Arrays.stream(paramArr).forEach(o -> {
FormItemResult value = allItemMap.get(o);
- if (value == null){
+ if (value == null) {
return;
}
- Set conditionSet = exportItem.getRemoteItemConditionMap().getOrDefault(item.getItemId(),new HashSet<>());
+ Set conditionSet = exportItem.getRemoteItemConditionMap().getOrDefault(item.getItemId(), new HashSet<>());
conditionSet.add(value);
- exportItem.getRemoteItemConditionMap().putIfAbsent(item.getItemId(),conditionSet);
+ exportItem.getRemoteItemConditionMap().putIfAbsent(item.getItemId(), conditionSet);
});
}
});
@@ -378,7 +414,7 @@ public class IcResiUserController implements ResultDataResolver {
stopSearchSet.add(tableName);
}
//如果没有 构建新的writeSheet
- WriteSheet writeSheet = childTableWriteSheetMap.getOrDefault(tableName,EasyExcel.writerSheet(tableEnum.getSheetNo()).build());
+ WriteSheet writeSheet = childTableWriteSheetMap.getOrDefault(tableName, EasyExcel.writerSheet(tableEnum.getSheetNo()).build());
childTableWriteSheetMap.putIfAbsent(tableName, writeSheet);
//写入数据
excelWriter.fill(new FillWrapper("t" + (tableEnum.getSheetNo() + NumConstant.ONE), resiResultList), writeSheet);
@@ -391,10 +427,10 @@ public class IcResiUserController implements ResultDataResolver {
}
} finally {
- if (excelWriter != null){
+ if (excelWriter != null) {
excelWriter.finish();
}
- log.info("exportExcelByEasyExcel resi info cost time:{}s",(System.currentTimeMillis()-startM)/NumConstant.ONE_THOUSAND);
+ log.info("exportExcelByEasyExcel resi info cost time:{}s", (System.currentTimeMillis() - startM) / NumConstant.ONE_THOUSAND);
}
}
@@ -404,7 +440,7 @@ public class IcResiUserController implements ResultDataResolver {
* @param customerId
* @return
*/
- private File getIcResiTemplateFile(String customerId, IcUserTemplateEnums template) throws Exception{
+ private File getIcResiTemplateFile(String customerId, IcUserTemplateEnums template) throws Exception {
String fileType = ".xlsx";
String fileName = customerId + fileType;
File file = new File(IC_RESI_DOWNLOAD_DIR.resolve(fileName).toString());
@@ -422,11 +458,11 @@ public class IcResiUserController implements ResultDataResolver {
if (result == null || !result.success()) {
log.warn("获取居民模版失败,path:{},走默认模版", ossFilePath);
InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream(template.getPathInApp());
- FileUtils.copyInputStreamToFile(resourceAsStream,file);
- log.warn("getIcResiTemplateFile copy default file to template,customerId:{}",customerId);
+ FileUtils.copyInputStreamToFile(resourceAsStream, file);
+ log.warn("getIcResiTemplateFile copy default file to template,customerId:{}", customerId);
} else {
- log.warn("getIcResiTemplateFile reload file form oss default file to template,customerId:{}",customerId);
- FileUtils.writeByteArrayToFile(file,result.getData());
+ log.warn("getIcResiTemplateFile reload file form oss default file to template,customerId:{}", customerId);
+ FileUtils.writeByteArrayToFile(file, result.getData());
}
redisUtils.hSet(RedisKeys.getResiTempChangedKey(customerId), serverIp, NumConstant.ZERO_STR);
return file;
@@ -441,7 +477,7 @@ public class IcResiUserController implements ResultDataResolver {
*/
@NoRepeatSubmit
@PostMapping("importExcel")
- public Result importExcelByEasyExcel(@RequestHeader("customerId") String customerId,@RequestPart("file") MultipartFile file, HttpServletRequest multipartRequest, HttpServletResponse response) {
+ public Result importExcelByEasyExcel(@RequestHeader("customerId") String customerId, @RequestPart("file") MultipartFile file, HttpServletRequest multipartRequest, HttpServletResponse response) {
if (file.isEmpty()) {
throw new RenException("请上传文件");
}
@@ -472,7 +508,7 @@ public class IcResiUserController implements ResultDataResolver {
executorService.execute(() -> {
boolean isAllSuccess = false;
try {
- List formItemList = icResiUserService.listFormItems(customerId,IcFormCodeEnum.RESI_BASE_INFO.getCode());
+ List formItemList = icResiUserService.listFormItems(customerId, IcFormCodeEnum.RESI_BASE_INFO.getCode());
isAllSuccess = icResiUserImportService.importIcResiInfoFromExcel(importTaskId, formItemList, importTempFileSavePath.toString(), response, IC_RESI_UPLOAD_DIR);
} catch (Throwable e) {
String errorMsg = ExceptionUtils.getThrowableErrorStackTrace(e);
@@ -490,7 +526,7 @@ public class IcResiUserController implements ResultDataResolver {
} finally {
try {
// 都导入成功了没问题,才删除
- if (importTempFileSavePath != null){
+ if (importTempFileSavePath != null) {
if (isAllSuccess) {
Files.delete(importTempFileSavePath);
} else {
@@ -522,9 +558,9 @@ public class IcResiUserController implements ResultDataResolver {
* @date 2021/11/3 9:21 上午
*/
@PostMapping("persondata")
- public Result personData(@LoginUser TokenDto tokenDto,@RequestBody PersonDataFormDTO formDTO) {
+ public Result personData(@LoginUser TokenDto tokenDto, @RequestBody PersonDataFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
- ValidatorUtils.validateEntity(formDTO,PersonDataFormDTO.PersonDataForm.class);
+ ValidatorUtils.validateEntity(formDTO, PersonDataFormDTO.PersonDataForm.class);
return new Result().ok(icResiUserService.personData(formDTO));
}
@@ -545,6 +581,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 需求: http://zentao.elinkservice.cn/task-view-4193.html 第11条
+ *
* @param formDTO
* @param tokenDto
* @return 根据分类搜索
@@ -594,10 +631,10 @@ public class IcResiUserController implements ResultDataResolver {
}
/**
- * @LoginUser TokenDto tokenDto,
- * 新增需求,需求人列表:展示当前工作人员所属组织+页面已选择所属网格 下的居民列表
* @param formDTO
* @return
+ * @LoginUser TokenDto tokenDto,
+ * 新增需求,需求人列表:展示当前工作人员所属组织+页面已选择所属网格 下的居民列表
*/
@PostMapping("demandusers")
public Result> queryDemandUsers(@RequestBody DemandUserFormDTO formDTO) {
@@ -607,6 +644,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 下载ic居民信息导入excel模板
+ *
* @return
*/
@PostMapping("import/download-template")
@@ -637,6 +675,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员年龄范围统计
+ *
* @Param formDTO
* @Return {@link Result< List< OptionDataResultDTO >>}
* @Author zhaoqifeng
@@ -650,6 +689,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员年龄列表
+ *
* @Param formDTO
* @Return {@link Result< PageData< PartyMemberEducationResultDTO>>}
* @Author zhaoqifeng
@@ -713,6 +753,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员学历统计
+ *
* @Param formDTO
* @Return {@link Result< List< OptionDataResultDTO>>}
* @Author zhaoqifeng
@@ -726,6 +767,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 党员学历列表
+ *
* @Param formDTO
* @Return {@link Result< PageData< PartyMemberEducationResultDTO>>}
* @Author zhaoqifeng
@@ -795,6 +837,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 根据居民id查询居民信息简介
+ *
* @param resiUserId
* @return
*/
@@ -807,12 +850,13 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 获取ic_resi_user
+ *
* @param icResiUserId
* @return
*/
@PostMapping("geticresiuser/{icResiUserId}")
- public Result getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId){
- if(StringUtils.isNotBlank(icResiUserId)){
+ public Result getIcResiUserDTO(@PathVariable("icResiUserId") String icResiUserId) {
+ if (StringUtils.isNotBlank(icResiUserId)) {
return new Result().ok(icResiUserService.get(icResiUserId));
}
return new Result<>();
@@ -820,6 +864,7 @@ public class IcResiUserController implements ResultDataResolver {
/**
* 【社区查询】搜索居民们
+ *
* @param input
* @return
*/
@@ -848,33 +893,34 @@ public class IcResiUserController implements ResultDataResolver {
}
/**
- * @Description 【社区查询】人员预警右侧列表
* @param formDTO
* @param tokenDto
+ * @Description 【社区查询】人员预警右侧列表
* @author zxc
* @date 2022/1/17 4:25 下午
*/
@PostMapping("personwarn/rightlist")
- public Result personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO,@LoginUser TokenDto tokenDto){
+ public Result personWarnRightList(@RequestBody PersonWarnRightListFormDTO formDTO, @LoginUser TokenDto tokenDto) {
ValidatorUtils.validateEntity(formDTO, PersonWarnRightListFormDTO.PersonWarnRightListForm.class);
- return new Result().ok(icResiUserService.personWarnRightList(formDTO,tokenDto));
+ return new Result().ok(icResiUserService.personWarnRightList(formDTO, tokenDto));
}
/**
* Desc: 根据房屋IDs查询房屋下是否有存在居民的
+ *
* @param ids
* @author zxc
* @date 2022/3/2 10:32 上午
*/
@PostMapping("getexistuserbyhouseids")
- public Result> getExistUserByHouseIds(@RequestBody List ids){
+ public Result> getExistUserByHouseIds(@RequestBody List ids) {
return new Result>().ok(icResiUserService.getExistUserByHouseIds(ids));
}
// public static ThreadLocal tl = new ThreadLocal();
@PostMapping("test-async")
- public Result testAsync(HttpServletRequest request){
+ public Result testAsync(HttpServletRequest request) {
// tl.set("wxz");
executorService.submit(() -> {
try {
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserAttachmentDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserAttachmentDao.java
new file mode 100644
index 0000000000..233a0e756c
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserAttachmentDao.java
@@ -0,0 +1,45 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.dto.result.PublicAndInternalFileResultDTO;
+import com.epmet.entity.IcResiUserAttachmentEntity;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 项目节点附件表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-12-21
+ */
+@Mapper
+public interface IcResiUserAttachmentDao extends BaseDao {
+
+ /**
+ * @Description 根据项目ID查询附件
+ * @Param projectId
+ * @author zxc
+ * @date 2020/12/21 下午4:33
+ */
+ List selectAttachByProjectId(@Param("projectId")String projectId);
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
index d3fe22ee44..93c49beb7f 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/IcResiUserDao.java
@@ -156,6 +156,8 @@ public interface IcResiUserDao extends BaseDao {
**/
IcResiUserDTO getResiUser(IcResiUserDTO dto);
+ IcResiUserDTO getResiUserByIdCard(@Param("idCard") String idCard,@Param("customerId") String customerId);
+
/**
* @param agencyId
* @param gridId
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserAttachmentEntity.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserAttachmentEntity.java
new file mode 100644
index 0000000000..a8bc7dd061
--- /dev/null
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/entity/IcResiUserAttachmentEntity.java
@@ -0,0 +1,119 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
+import com.epmet.commons.tools.constant.FieldConstant;
+import com.epmet.commons.tools.page.PageData;
+import com.epmet.commons.tools.utils.ConvertUtils;
+import com.epmet.dao.IcResiUserAttachmentDao;
+import com.epmet.dto.IcResiUserAttachmentDTO;
+import com.epmet.entity.IcResiUserAttachmentEntity;
+import com.epmet.service.IcResiUserAttachmentService;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 项目节点附件表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-12-21
+ */
+@Service
+public class IcResiUserAttachmentServiceImpl extends BaseServiceImpl implements IcResiUserAttachmentService {
+
+ @Override
+ public PageData page(Map params) {
+ IPage page = baseDao.selectPage(
+ getPage(params, FieldConstant.CREATED_TIME, false),
+ getWrapper(params)
+ );
+ return getPageData(page, IcResiUserAttachmentDTO.class);
+ }
+
+ @Override
+ public List list(Map params) {
+ List entityList = baseDao.selectList(getWrapper(params));
+
+ return ConvertUtils.sourceToTarget(entityList, IcResiUserAttachmentDTO.class);
+ }
+
+ private QueryWrapper getWrapper(Map params){
+ String id = (String)params.get(FieldConstant.ID_HUMP);
+
+ QueryWrapper wrapper = new QueryWrapper<>();
+ wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
+
+ return wrapper;
+ }
+
+ @Override
+ public IcResiUserAttachmentDTO get(String id) {
+ IcResiUserAttachmentEntity entity = baseDao.selectById(id);
+ return ConvertUtils.sourceToTarget(entity, IcResiUserAttachmentDTO.class);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void save(IcResiUserAttachmentDTO dto) {
+ IcResiUserAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserAttachmentEntity.class);
+ insert(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void update(IcResiUserAttachmentDTO dto) {
+ IcResiUserAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IcResiUserAttachmentEntity.class);
+ updateById(entity);
+ }
+
+ @Override
+ @Transactional(rollbackFor = Exception.class)
+ public void delete(String[] ids) {
+ // 逻辑删除(@TableLogic 注解)
+ baseDao.deleteBatchIds(Arrays.asList(ids));
+ }
+
+}
\ No newline at end of file
diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
index 4b3dab701f..5744c10f62 100644
--- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
+++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java
@@ -101,7 +101,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getWrapper(Map params){
- String id = (String)params.get(FieldConstant.ID_HUMP);
+ private QueryWrapper getWrapper(Map params) {
+ String id = (String) params.get(FieldConstant.ID_HUMP);
QueryWrapper wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
@@ -172,7 +175,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl NumConstant.ZERO ) {
+ if (str.length() > NumConstant.ZERO) {
String errorMsg = String.format("新增居民信息,必要字段值为空,%s值为空", str);
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), errorMsg, errorMsg);
}
@@ -193,7 +196,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> categoryListResult = operCustomizeOpenFeignClient.getCategoryList(sfdto);
- if (!categoryListResult.success()){
+ if (!categoryListResult.success()) {
throw new RenException("居民信息修改,获取客户居民类别预警配置表数据失败");
}
//修改前数据库居民十八类信息值
@@ -495,7 +521,7 @@ public class IcResiUserServiceImpl extends BaseServiceImpl getPeopleByRoom(String homeId) {
- if(StringUtils.isBlank(homeId)) {
+ if (StringUtils.isBlank(homeId)) {
return Collections.emptyList();
}
LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>();
@@ -515,72 +541,70 @@ public class IcResiUserServiceImpl extends BaseServiceImpl> pageResiMap(IcResiUserPageFormDTO formDTO) {
- CustomerStaffInfoCacheResult staffInfoCacheResult=CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(),formDTO.getStaffId());
+ CustomerStaffInfoCacheResult staffInfoCacheResult = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getStaffId());
String staffOrgPath;
- if(StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds())&& !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())){
- staffOrgPath=staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
- }else{
- staffOrgPath=staffInfoCacheResult.getAgencyId();
+ if (StringUtils.isNotBlank(staffInfoCacheResult.getAgencyPIds()) && !NumConstant.ZERO_STR.equals(staffInfoCacheResult.getAgencyPIds())) {
+ staffOrgPath = staffInfoCacheResult.getAgencyPIds().concat(":").concat(staffInfoCacheResult.getAgencyId());
+ } else {
+ staffOrgPath = staffInfoCacheResult.getAgencyId();
}
// 查询列表展示项,如果没有,直接返回
- CustomerFormQueryDTO queryDTO1=new CustomerFormQueryDTO();
+ CustomerFormQueryDTO queryDTO1 = new CustomerFormQueryDTO();
queryDTO1.setCustomerId(formDTO.getCustomerId());
queryDTO1.setFormCode(formDTO.getFormCode());
- Result> resultColumnRes=operCustomizeOpenFeignClient.queryConditions(queryDTO1);
+ Result> resultColumnRes = operCustomizeOpenFeignClient.queryConditions(queryDTO1);
if (!resultColumnRes.success() || CollectionUtils.isEmpty(resultColumnRes.getData())) {
log.warn("没有配置列表展示列");
return new PageData(new ArrayList(), NumConstant.ZERO);
}
List resultColumns = resultColumnRes.getData();
// 查询结果列对应的表:
- Set resultColumnTables=resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet());
+ Set resultColumnTables = resultColumns.stream().map(IcFormResColumnDTO::getTableName).collect(Collectors.toSet());
// 查询列表展示项需要用到哪些子表
- Result> subTablesRes=operCustomizeOpenFeignClient.querySubTables(queryDTO1);
- List subTables =subTablesRes.getData();
+ Result> subTablesRes = operCustomizeOpenFeignClient.querySubTables(queryDTO1);
+ List subTables = subTablesRes.getData();
// log.info("1、所有的子表subTables:"+JSON.toJSONString(subTables,true));
//关联哪些子表:查询条件用到的表名+查询的列对应的表 并集去重
- Set whereConditionTables=formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
- Set tables=new HashSet<>();
+ Set whereConditionTables = formDTO.getConditions().stream().map(ResiUserQueryValueDTO::getTableName).collect(Collectors.toSet());
+ Set tables = new HashSet<>();
tables.addAll(whereConditionTables);
tables.addAll(resultColumnTables);
// log.info("2、查询条件+查询列对应的tables并集去重:"+ JSON.toJSONString(tables,true));
//最终关联的子表对应的sql:
- List finalSubTables =new ArrayList<>();
- subTables.forEach(subTable->{
- if(tables.contains(subTable.getTableName())){
+ List finalSubTables = new ArrayList<>();
+ subTables.forEach(subTable -> {
+ if (tables.contains(subTable.getTableName())) {
finalSubTables.add(subTable.getJoinTableSql());
}
});
- PageInfo