From b7f5e8b909da7710e13079152f2d7e782437f106 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Sat, 11 Apr 2020 14:47:50 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E5=85=9A=E5=91=98=E8=AE=A4=E8=AF=81bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 8 +- .../PartymemberConfirmAutoDTO.java | 5 + .../epmet/constant/PartyMemberConstant.java | 14 +- .../modules/feign/EpmetUserFeignClient.java | 3 +- .../service/PartyMemberConfirmService.java | 1 + .../PartymemberConfirmAutoService.java | 10 ++ .../PartymemberConfirmManualService.java | 116 +++++++++-------- .../impl/PartyMemberConfirmServiceImpl.java | 55 +++++--- .../impl/PartymemberBaseInfoServiceImpl.java | 41 +++--- .../PartymemberConfirmAutoServiceImpl.java | 120 ++++++++++-------- .../PartymemberConfirmManualServiceImpl.java | 8 ++ .../mapper/partymember/PartymemberInfoDao.xml | 15 ++- 12 files changed, 237 insertions(+), 159 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 46e63ab382..1495df359d 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -12,10 +12,10 @@ public enum EpmetErrorCode { ALREADY_APPLIED_GROUP(8004,"该群已申请过,请耐心等待审核"), LOSE_EFFICACY(8006,"此邀请链接已过期"), - MOBILE_HAS_BEEN_USED(8101, "该手机已被使用,请更换手机或使用原绑定的微信用户登录"), - MOBILE_CODE_ERROR(8102, "手机验证码错误"), - AUTO_CONFIRM_FAILED(8103, "自动认证失败"), - MOBILE_GET_CODE_ERROR(8104,"获取手机验证码失败"), + MOBILE_HAS_BEEN_USED(8101, "该手机号已注册,请更换手机号或使用原绑定的微信账号登录"), + MOBILE_CODE_ERROR(8102, "验证码错误"), + AUTO_CONFIRM_FAILED(8103, "党员注册失败"), + MOBILE_GET_CODE_ERROR(8104,"获取验证码失败"), MESSAGE_SMS_SEND_ERROR(8105, "短信发送失败"), CANNOT_AUDIT_WARM(8201, "未注册居民不能申请热心居民,请先完善居民注册。"), diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberConfirmAutoDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberConfirmAutoDTO.java index bd17f2582b..2499990b59 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberConfirmAutoDTO.java +++ b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/PartymemberConfirmAutoDTO.java @@ -135,4 +135,9 @@ public class PartymemberConfirmAutoDTO implements Serializable { */ private Date updatedTime; + /** + * 比对结果 + */ + private Boolean comparisonResults; + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java index 6fcea577b8..b281285467 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/constant/PartyMemberConstant.java @@ -49,37 +49,37 @@ public interface PartyMemberConstant { /** * 比对结果相同 */ - Double EQUALS = 1.0; + Double EQUALS = 0.0; /** * 身份证比对结果大部分相同最低值 */ - Double ID_MOST = 0.88; + Double ID_MOST = 2.0; /** * 身份证比对结果小部分相同最低值 */ - Double ID_SMALL = 0.5; + Double ID_SMALL = 5.0; /** * 手机号比对结果大部分相同最低值 */ - Double MOBILE_MOST = 0.81; + Double MOBILE_MOST = 2.0; /** * 手机号比对结果小部分相同最低值 */ - Double MOBILE_SMALL = 0.5; + Double MOBILE_SMALL = 5.0; /** * 姓名比对结果大部分相同最低值 */ - Double NAME_MOST = 0.66; + Double NAME_MOST = 1.0; /** * 姓名比对结果小部分相同最低值 */ - Double NAME_SMALL = 0.5; + Double NAME_SMALL = 2.0; /** * 比对结果相同 diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java index 211ae18ba8..9985019a59 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/feign/EpmetUserFeignClient.java @@ -16,7 +16,8 @@ import org.springframework.web.bind.annotation.RequestBody; * @dscription * @date 2020/3/30 14:51 */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class,url="http://localhost:8087") +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserFeignClientFallBack.class,url = + "http://localhost:8087") public interface EpmetUserFeignClient { /** diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java index e9503682e1..feee93b3cc 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartyMemberConfirmService.java @@ -46,4 +46,5 @@ public interface PartyMemberConfirmService { */ Result partyMemberInfoExtra(PartymemberInfoDTO partyMemberInfoDTO); + } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmAutoService.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmAutoService.java index 57c73e6c0f..22bab006b9 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmAutoService.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/PartymemberConfirmAutoService.java @@ -93,4 +93,14 @@ public interface PartymemberConfirmAutoService extends BaseService { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2020-03-30 - */ - PageData page(Map params); + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-03-30 + */ + PageData page(Map params); - /** - * 默认查询 - * - * @param params - * @return java.util.List - * @author generator - * @date 2020-03-30 - */ - List list(Map params); + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-03-30 + */ + List list(Map params); - /** - * 单条查询 - * - * @param id - * @return PartymemberConfirmManualDTO - * @author generator - * @date 2020-03-30 - */ - PartymemberConfirmManualDTO get(String id); + /** + * 单条查询 + * + * @param id + * @return PartymemberConfirmManualDTO + * @author generator + * @date 2020-03-30 + */ + PartymemberConfirmManualDTO get(String id); - /** - * 默认保存 - * - * @param dto - * @return void - * @author generator - * @date 2020-03-30 - */ - void save(PartymemberConfirmManualDTO dto); + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-30 + */ + void save(PartymemberConfirmManualDTO dto); - /** - * 默认更新 - * - * @param dto - * @return void - * @author generator - * @date 2020-03-30 - */ - void update(PartymemberConfirmManualDTO dto); + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-03-30 + */ + void update(PartymemberConfirmManualDTO dto); - /** - * 批量删除 - * - * @param ids - * @return void - * @author generator - * @date 2020-03-30 - */ - void delete(String[] ids); + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-03-30 + */ + void delete(String[] ids); + + /** + * 单条查询 + * + * @param partymemberInfoId + * @return + */ + PartymemberConfirmManualDTO getInfoByPartyMemberInfoId(String partymemberInfoId); } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 1606179d24..5d7e6cff76 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java @@ -18,7 +18,9 @@ import com.epmet.resi.mine.dto.from.PartyMemberInitFromDTO; import com.epmet.resi.mine.dto.from.VerificationCodeFromDTO; import com.epmet.resi.mine.dto.result.PartyMemberInitResultDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; +import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmManualDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; +import com.epmet.resi.partymember.dto.partymember.form.PartyMemberVerifyFromDTO; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -81,8 +83,9 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService userResiInfoFormDTO.setUserId(fromDto.getUserId()); UserResiInfoResultDTO userResiInfoResult = epmetUserFeignClient.getUserResiInfoDTO(userResiInfoFormDTO).getData(); if (null != userResiInfoResult) { - PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult, + PartymemberInfoDTO partyMemberInfo = ConvertUtils.sourceToTarget(userResiInfoResult, PartymemberInfoDTO.class); + partyMemberInfo.setId(""); partyMemberInfo.setMobile(userResiInfoResult.getRegMobile()); partyMemberInfo.setEstate(userResiInfoResult.getDistrict()); partyMemberInfo.setBuilding(userResiInfoResult.getBuildingAddress()); @@ -115,7 +118,7 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService //生成短信验证码 Map message = (Map) messageFeignClient.sendSmsCaptcha(fromDTO.getMobile()).getData(); - if(null == message) { + if (null == message) { result.setCode(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getCode()); result.setMsg(EpmetErrorCode.MOBILE_GET_CODE_ERROR.getMsg()); return result; @@ -157,13 +160,18 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberInfoEntity partyMemberInfoEntity = ConvertUtils.sourceToTarget(partyMemberInfoDTO, PartymemberInfoEntity.class); - if (confirmAutoDTO == null || confirmAutoDTO.getResult().compareTo(PartyMemberConstant.BENCHMARK) < 0) { + if (confirmAutoDTO == null || (confirmAutoDTO.getResult().compareTo(PartyMemberConstant.BENCHMARK) < 0 && !confirmAutoDTO.getComparisonResults())) { //将访问记录更新到热心居民申请行为记录表 saveOrUpdateVisit(partyMemberInfoDTO.getPartymemberVisitId(), null, PartyMemberConstant.OPERATE_AUTO_FAILED); //自动认证失败 partyMemberInfoEntity.setConfirmResult("1"); - partymemberInfoService.insert(partyMemberInfoEntity); + if (partyMemberInfoEntity.getId().isEmpty()) { + partymemberInfoService.insert(partyMemberInfoEntity); + } else { + partymemberInfoService.updateById(partyMemberInfoEntity); + } + result.setCode(EpmetErrorCode.AUTO_CONFIRM_FAILED.getCode()); result.setMsg(EpmetErrorCode.AUTO_CONFIRM_FAILED.getMsg()); @@ -173,7 +181,11 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService //自动认证成功 partyMemberInfoEntity.setConfirmResult("0"); - partymemberInfoService.insert(partyMemberInfoEntity); + if (partyMemberInfoEntity.getId().isEmpty()) { + partymemberInfoService.insert(partyMemberInfoEntity); + } else { + partymemberInfoService.updateById(partyMemberInfoEntity); + } //添加用户党员角色关系 UserRoleDTO userRole = new UserRoleDTO(); @@ -188,9 +200,17 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService //将自动认证结果存入党员认证自动审核表 if (confirmAutoDTO != null) { + PartymemberConfirmAutoDTO partymemberConfirmAutoDTO = + partymemberConfirmAutoService.getInfoByPartyMemberInfoId(partyMemberInfoEntity.getPartymemberVisitId()); confirmAutoDTO.setPartymemberInfoId(partyMemberInfoEntity.getPartymemberVisitId()); - partymemberConfirmAutoService.insert(ConvertUtils.sourceToTarget(confirmAutoDTO, - PartymemberConfirmAutoEntity.class)); + if (null == partymemberConfirmAutoDTO) { + partymemberConfirmAutoService.insert(ConvertUtils.sourceToTarget(confirmAutoDTO, + PartymemberConfirmAutoEntity.class)); + } else { + confirmAutoDTO.setId(partymemberConfirmAutoDTO.getId()); + partymemberConfirmAutoService.updateById(ConvertUtils.sourceToTarget(confirmAutoDTO, + PartymemberConfirmAutoEntity.class)); + } } //判断是否已注册居民,如果没有则注册居民 @@ -209,15 +229,20 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService PartymemberInfoDTO partyMemberInfo = partymemberInfoService.getPartyMemberInfo(infoDTO); infoDTO.setId(partyMemberInfo.getId()); partymemberInfoService.updateById(ConvertUtils.sourceToTarget(infoDTO, PartymemberInfoEntity.class)); + PartymemberConfirmManualDTO partymemberConfirmManualDTO = + partymemberConfirmManualService.getInfoByPartyMemberInfoId(partyMemberInfo.getId()); + + if (null == partymemberConfirmManualDTO) { + //待审核数据存入党员认证人工审核表 + PartymemberConfirmManualEntity manualEntity = new PartymemberConfirmManualEntity(); + manualEntity.setCustomerId(infoDTO.getCustomerId()); + manualEntity.setGridId(infoDTO.getGridId()); + manualEntity.setUserId(infoDTO.getUserId()); + manualEntity.setPartymemberInfoId(infoDTO.getId()); + manualEntity.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING); + partymemberConfirmManualService.insert(manualEntity); + } - //待审核数据存入党员认证人工审核表 - PartymemberConfirmManualEntity manualEntity = new PartymemberConfirmManualEntity(); - manualEntity.setCustomerId(infoDTO.getCustomerId()); - manualEntity.setGridId(infoDTO.getGridId()); - manualEntity.setUserId(infoDTO.getUserId()); - manualEntity.setPartymemberInfoId(infoDTO.getId()); - manualEntity.setAuditStatus(PartyMemberConstant.UNDER_AUDITTING); - partymemberConfirmManualService.insert(manualEntity); return new Result(); } diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java index c70c32c7d8..2f8e281b68 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberBaseInfoServiceImpl.java @@ -31,7 +31,7 @@ import com.epmet.modules.partymember.service.PartymemberBaseInfoService; import com.epmet.resi.partymember.dto.partymember.PartymemberBaseInfoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberConfirmAutoDTO; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; -import info.debatty.java.stringsimilarity.JaroWinkler; +import info.debatty.java.stringsimilarity.Levenshtein; import org.apache.commons.lang3.StringUtils; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; @@ -129,7 +129,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl baseInfo.getMobile().equals(partyMemberInfo.getMobile())).findFirst(); if (matchingResult.isPresent()) { - confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo); + confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true); return confirmAutoDTO; } @@ -137,7 +137,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl baseInfo.getName().equals(name)).findFirst(); if (matchingResult.isPresent()) { - confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo); + confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true); return confirmAutoDTO; } @@ -147,7 +147,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl mobileList = baseDao.selectBaseInfoByIdCard(partyMemberInfo); + List mobileList = baseDao.selectBaseInfoByMobile(partyMemberInfo); if (null != mobileList && mobileList.size() > 0) { //判断手机号和姓名 @@ -155,7 +155,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl baseInfo.getName().equals(name)).findFirst(); if (matchingResult.isPresent()) { - confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo); + confirmAutoDTO = getResult(matchingResult.get(), partyMemberInfo, true); return confirmAutoDTO; } @@ -164,7 +164,7 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl nameList = baseDao.selectBaseInfoByIdCard(partyMemberInfo); + List nameList = baseDao.selectBaseInfoByName(partyMemberInfo); if (null != nameList && nameList.size() > 0) { //获取匹配度最高的数据 @@ -175,13 +175,20 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0); - confirmAutoDTO = getResult(similar, partyMemberInfo); + confirmAutoDTO = getResult(similar, partyMemberInfo, false); return confirmAutoDTO; + } else { + return null; } } } - return null; + + PartymemberBaseInfoEntity similar = + sortList.stream().sorted(Comparator.comparing((PartymemberBaseInfoEntity p) -> + getSimilarity(p, partyMemberInfo)).reversed()).collect(Collectors.toList()).get(0); + + return getResult(similar, partyMemberInfo, false); } @@ -192,7 +199,8 @@ public class PartymemberBaseInfoServiceImpl extends BaseServiceImpl most) { + } else if (comparisonResult <= most) { result = result + "10"; - } else if (comparisonResult < small) { + } else if (comparisonResult >= small) { result = result + "00"; } else { result = result + "01"; diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmAutoServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmAutoServiceImpl.java index 7681ed60dc..7000a9a731 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmAutoServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmAutoServiceImpl.java @@ -38,8 +38,8 @@ import java.util.List; import java.util.Map; /** - * 党员认证自动审核表 -只有在根据三项比对在partymember_base_info表有查询到数据 并且有一项的比对结果是11的才会在自动审核表有记录 + * 党员认证自动审核表 + * 只有在根据三项比对在partymember_base_info表有查询到数据 并且有一项的比对结果是11的才会在自动审核表有记录 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-03-30 @@ -47,59 +47,67 @@ import java.util.Map; @Service public class PartymemberConfirmAutoServiceImpl extends BaseServiceImpl implements PartymemberConfirmAutoService { - @Autowired - private PartymemberConfirmAutoRedis partymemberConfirmAutoRedis; - - @Override - public PageData page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, PartymemberConfirmAutoDTO.class); - } - - @Override - public List list(Map params) { - List entityList = baseDao.selectList(getWrapper(params)); - - return ConvertUtils.sourceToTarget(entityList, PartymemberConfirmAutoDTO.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 PartymemberConfirmAutoDTO get(String id) { - PartymemberConfirmAutoEntity entity = baseDao.selectById(id); - return ConvertUtils.sourceToTarget(entity, PartymemberConfirmAutoDTO.class); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void save(PartymemberConfirmAutoDTO dto) { - PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class); - insert(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(PartymemberConfirmAutoDTO dto) { - PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class); - updateById(entity); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void delete(String[] ids) { - // 逻辑删除(@TableLogic 注解) - baseDao.deleteBatchIds(Arrays.asList(ids)); - } + @Autowired + private PartymemberConfirmAutoRedis partymemberConfirmAutoRedis; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, PartymemberConfirmAutoDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, PartymemberConfirmAutoDTO.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 PartymemberConfirmAutoDTO get(String id) { + PartymemberConfirmAutoEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, PartymemberConfirmAutoDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(PartymemberConfirmAutoDTO dto) { + PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PartymemberConfirmAutoDTO dto) { + PartymemberConfirmAutoEntity entity = ConvertUtils.sourceToTarget(dto, PartymemberConfirmAutoEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + public PartymemberConfirmAutoDTO getInfoByPartyMemberInfoId(String partymemberInfoId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(partymemberInfoId), "PARTYMEMBER_INFO_ID", partymemberInfoId); + PartymemberConfirmAutoEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, PartymemberConfirmAutoDTO.class); + } } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java index 8922637b53..926218c9ef 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartymemberConfirmManualServiceImpl.java @@ -101,4 +101,12 @@ public class PartymemberConfirmManualServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(partymemberInfoId), "PARTYMEMBER_INFO_ID", partymemberInfoId); + PartymemberConfirmManualEntity entity = baseDao.selectOne(wrapper); + return ConvertUtils.sourceToTarget(entity, PartymemberConfirmManualDTO.class); + } + } \ No newline at end of file diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml index 46c290d959..0eb6e6a06e 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberInfoDao.xml @@ -31,14 +31,17 @@