diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java index be1858c9e2..132ea8e175 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/dao/LogOperationDao.java @@ -41,8 +41,7 @@ public interface LogOperationDao extends BaseDao { @Param("endTime")String endTime, @Param("operatorName")String operatorName, @Param("operatorMobile")String operatorMobile, - @Param("category")String category, - @Param("agencyId")String agencyId); + @Param("category")String category); List> getStaffId(); diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java index fae8de2b7c..7f6f220410 100644 --- a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/service/impl/LogOperationServiceImpl.java @@ -8,7 +8,6 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; -import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.common.CustomerStaffRedis; @@ -202,15 +201,15 @@ public class LogOperationServiceImpl implements LogOperationService, ResultDataR @Override public PageData page(String customerId, String startTime, String endTime, String operatorName, String operatorMobile, Integer pageNo, Integer pageSize, String category, TokenDto tokenDto) { - CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); - if (null == staffInfo){ - throw new EpmetException("未查询工作人员信息:"+tokenDto.getUserId()); - } + // CustomerStaffInfoCacheResult staffInfo = CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); + // if (null == staffInfo){ + // throw new EpmetException("未查询工作人员信息:"+tokenDto.getUserId()); + // } // 列表/导出查询 PageHelper.startPage(pageNo, pageSize); - List list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category,staffInfo.getAgencyId()); + List list = logOperationDao.pageList(customerId, startTime, endTime, operatorName, operatorMobile,category); PageInfo pageInfo = new PageInfo<>(list); - return new PageData<>(list, pageInfo.getTotal()); + return new PageData<>(list, pageInfo.getTotal(),pageSize); } /** diff --git a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml index 032973b7fe..ed564864f6 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml +++ b/epmet-admin/epmet-admin-server/src/main/resources/mapper/LogOperationDao.xml @@ -64,7 +64,6 @@ WHERE lo.del_flag = '0' AND lo.CUSTOMER_ID = #{customerId} - AND lo.ORG_ID_PATH LIKE concat('%',#{agencyId},'%') AND lo.CATEGORY = #{category} diff --git a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java index 08e40eb99d..ff7a0f9a79 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/LoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/LoginController.java @@ -29,6 +29,8 @@ import java.io.IOException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * @Description 通用登录接口 @@ -73,6 +75,20 @@ public class LoginController { } } + /** + * 返回文字版的验证码 + * 磐石大屏3.10号提出的需求 + * @param uuid + * @throws IOException + */ + @PostMapping("captcha/{uuid}") + public Result captcha(@PathVariable(name = "uuid", required = true) String uuid) { + Map map = new HashMap<>(); + map.put("captcha", captchaService.getTextCaptcha(uuid)); + return new Result().ok(map); + + } + /** * @param formDTO * @return com.epmet.commons.tools.utils.Result diff --git a/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java b/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java index d6f8573e65..c2064bb418 100644 --- a/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java +++ b/epmet-auth/src/main/java/com/epmet/service/CaptchaService.java @@ -31,4 +31,11 @@ public interface CaptchaService { */ boolean validate(String uuid, String code); + /** + * 返回文字版的验证码 + * 磐石大屏3.10号提出的需求 + * @param uuid + * @return + */ + String getTextCaptcha(String uuid); } diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index eb93a5bb97..6253f7481e 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -133,4 +133,6 @@ public interface ThirdLoginService { * * @return UserTokenResultDTO */ UserTokenResultDTO sdtSSOLogin(String authCode, String customerId); + + void sendLoginEvent(String userId, String appId, String fromApp, String fromClient,String messageType); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java index fbdf85b00b..15c239dd6d 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/CaptchaServiceImpl.java @@ -52,4 +52,21 @@ public class CaptchaServiceImpl implements CaptchaService { //验证码是否正确 return code.equalsIgnoreCase(captcha); } + + /** + * 返回文字版的验证码 + * 磐石大屏3.10号提出的需求 + * + * @param uuid + * @return + */ + @Override + public String getTextCaptcha(String uuid) { + // 生成验证码 //producer.createText(); + String captcha = StringRandomUtils.getRandomStr(NumConstant.FIVE); + // logger.info("uuid:"+uuid+",生成的验证码:"+captcha); + // 保存验证码 + captchaRedis.set(uuid, captcha); + return captcha; + } } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java index 24267debd1..8236a63a90 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; +import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; @@ -11,10 +12,7 @@ import com.epmet.commons.tools.feign.ResultDataResolver; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.CpUserDetailRedis; -import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.CustomerAgencyDTO; @@ -31,6 +29,7 @@ import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; import com.epmet.service.GovLoginService; import com.epmet.service.LoginService; +import com.epmet.service.ThirdLoginService; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -326,6 +325,8 @@ public class GovLoginServiceImpl implements GovLoginService, ResultDataResolver throw new RenException("当前用户信息获取失败"); } cpUserDetailRedis.logout(tokenDto.getApp() , tokenDto.getClient() , tokenDto.getUserId()); + SpringContextUtils.getBean(ThirdLoginService.class).sendLoginEvent(tokenDto.getUserId(), "小程序内退出登录", + tokenDto.getApp(), tokenDto.getClient(), AuthOperationConstants.LOGOUT); } @Override diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java index c03bf7c629..0725f9974b 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java @@ -1,7 +1,9 @@ package com.epmet.service.impl; +import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.auth.dto.result.BlockChainStaffAuthResultDTO; import com.epmet.common.token.constant.LoginConstant; +import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -14,6 +16,7 @@ import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.dto.form.GovWebLoginFormDTO; import com.epmet.dto.form.GovWebOperLoginFormDTO; import com.epmet.dto.result.GovWebOperLoginResultDTO; @@ -23,6 +26,7 @@ import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.service.CaptchaService; import com.epmet.service.GovWebService; +import com.epmet.service.ThirdLoginService; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -103,6 +107,15 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver { UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setCustomerId(formDTO.getCustomerId()); userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId())); + // 6.发送登录事件 + try { + SpringContextUtils.getBean(ThirdLoginService.class).sendLoginEvent(resultDTO.getUserId(), "数字社区登录", + AppClientConstant.APP_GOV, + AppClientConstant.CLIENT_WEB, + AuthOperationConstants.LOGIN); + } catch (Exception e) { + log.error("【数字社区web端登录】发送登录事件失败,程序继续执行。错误信息"); + } return userTokenResultDTO; } @@ -131,6 +144,9 @@ public class GovWebServiceImpl implements GovWebService, ResultDataResolver { //5.生成token存到redis并返回 UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO(); userTokenResultDTO.setToken(this.packagingUserToken(formDTO, resultDTO.getUserId())); + //6、增加登录日志 + thirdLoginService.sendLoginEvent(resultDTO.getUserId(), "数字社区登录", + formDTO.getApp(), formDTO.getClient(), AuthOperationConstants.LOGIN); return userTokenResultDTO; } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java index 3e1e580fce..30fc10027b 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java @@ -5,6 +5,7 @@ import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult; import cn.binarywang.wx.miniapp.bean.WxMaPhoneNumberInfo; import cn.binarywang.wx.miniapp.bean.WxMaUserInfo; import com.alibaba.fastjson.JSON; +import com.epmet.auth.constants.AuthOperationConstants; import com.epmet.common.token.constant.LoginConstant; import com.epmet.commons.tools.constant.AppClientConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -15,6 +16,7 @@ import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.CpUserDetailRedis; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.UserDTO; import com.epmet.dto.UserWechatDTO; @@ -28,6 +30,7 @@ import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CustomerAppWxServiceUtil; import com.epmet.service.CaptchaService; import com.epmet.service.LoginService; +import com.epmet.service.ThirdLoginService; import com.epmet.utils.WxMaServiceUtils; import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.common.error.WxErrorException; @@ -372,6 +375,8 @@ public class LoginServiceImpl implements LoginService { if(AppClientConstant.APP_GOV.equals(tokenDto.getApp())){ CustomerStaffRedis.delStaffInfoFormCache(tokenDto.getCustomerId(),tokenDto.getUserId()); } + SpringContextUtils.getBean(ThirdLoginService.class).sendLoginEvent(tokenDto.getUserId(), "数字社区退出登录", + tokenDto.getApp(), tokenDto.getClient(), AuthOperationConstants.LOGOUT); return new Result(); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 4aba325317..01b57a4fb3 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -24,7 +24,6 @@ import com.epmet.commons.tools.redis.common.bean.DingMiniInfoCache; import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; -import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.*; import com.epmet.commons.tools.utils.api.yt.YantaiApi; import com.epmet.commons.tools.utils.api.yt.YantaiSSOUser; @@ -36,7 +35,10 @@ import com.epmet.dto.dingres.DingUserDetailDTO; import com.epmet.dto.dingres.V2UserGetuserinfoResDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.feign.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.feign.GovOrgOpenFeignClient; +import com.epmet.feign.ThirdOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; import com.epmet.jwt.JwtTokenUtils; import com.epmet.redis.CaptchaRedis; @@ -89,14 +91,10 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol @Autowired private EpmetMessageOpenFeignClient messageOpenFeignClient; @Autowired - private LoginUserUtil loginUserUtil; - @Autowired private DingTalkClientToken dingTalkClientToken; @Autowired private DingTalkClientUser dingTalkClientUser; @Autowired - private EpmetUserFeignClient epmetUserFeignClient; - @Autowired private GovWebService govWebService; @Autowired private ThirdOpenFeignClient thirdOpenFeignClient; @@ -226,7 +224,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //7.发送登录事件 try { - sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); + sendLoginEvent(staffLatestAgencyResultDTO.getStaffId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, AuthOperationConstants.LOGIN); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -457,7 +455,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //6.发送登录事件 try { - sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, AuthOperationConstants.LOGIN); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -519,7 +517,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //6.发送登录事件 try { - sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP); + sendLoginEvent(customerStaff.getUserId(), formDTO.getAppId(), AppClientConstant.APP_GOV, AppClientConstant.CLIENT_WXMP, AuthOperationConstants.LOGIN); } catch (RenException e) { log.error(e.getInternalMsg()); } catch (Exception e) { @@ -844,7 +842,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol * @author wxz * @date 2021.06.08 15:27 */ - private void sendLoginEvent(String userId, String appId, String fromApp, String fromClient) { + @Override + public void sendLoginEvent(String userId, String appId, String fromApp, String fromClient,String messageType) { HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); LoginMQMsg loginMQMsg = new LoginMQMsg(); @@ -855,7 +854,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol loginMQMsg.setFromApp(fromApp); loginMQMsg.setFromClient(fromClient); SystemMsgFormDTO form = new SystemMsgFormDTO(); - form.setMessageType(AuthOperationConstants.LOGIN); + // form.setMessageType(AuthOperationConstants.LOGIN); + form.setMessageType(messageType); form.setContent(loginMQMsg); messageOpenFeignClient.sendSystemMsgByMQ(form); //getResultDataOrThrowsException(result, ServiceConstant.EPMET_MESSAGE_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "调用Message服务,发送登录事件到MQ失败"); diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java index 131322a8a6..7cf90b4b9d 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StatsResiListFormDTO.java @@ -21,6 +21,7 @@ import lombok.Data; import javax.validation.constraints.NotBlank; import java.io.Serializable; +import java.util.List; /** @@ -37,8 +38,13 @@ public class StatsResiListFormDTO implements Serializable { /** * 组织id */ - @NotBlank(message = "id不能为空") + // @NotBlank(message = "id不能为空") private String id; + /** + * 目前只支持传入小区id + * level:neighborHood + */ + private List idList; @NotBlank(message = "level不能为空") private String level; diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java index 3003dec607..4d1912682b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StatsResiWarnController.java @@ -19,6 +19,8 @@ package com.epmet.controller; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.annotation.MaskResponse; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.EpmetException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; @@ -34,6 +36,7 @@ import com.epmet.dto.result.IcUserWarnNoticeResultDTO; import com.epmet.dto.result.UserWarnNameListResultDTO; import com.epmet.service.IcStatsResiWarnService; import com.epmet.service.StatsResiWarnService; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.PostMapping; @@ -67,7 +70,10 @@ public class StatsResiWarnController { public Result> list(@LoginUser TokenDto tokenDto,@RequestBody StatsResiListFormDTO formDTO){ ValidatorUtils.validateEntity(formDTO); String customerId = tokenDto.getCustomerId(); - List icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel()); + if (StringUtils.isBlank(formDTO.getId()) && CollectionUtils.isEmpty(formDTO.getIdList())) { + throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(), "id或者idList不能同时为空", "参数错误"); + } + List icStatsResiResultDTOList = statsResiWarnService.list(customerId,formDTO.getId(),formDTO.getLevel(),formDTO.getIdList()); return new Result>().ok(icStatsResiResultDTOList); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDeathDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDeathDao.java index 4633fa4ea5..6d915dd477 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDeathDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/DataSyncRecordDeathDao.java @@ -29,4 +29,6 @@ public interface DataSyncRecordDeathDao extends BaseDao entities); + + /** + * 删除居民信息时,同时删除data_sync_record_disability + * @param icResiUserId + * @return + */ + int deleteByIcResiUserId(String icResiUserId); } 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 e6845fefd3..bb215e3734 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 @@ -19,7 +19,6 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.commons.tools.dto.result.OptionDataResultDTO; -import com.epmet.commons.tools.page.PageData; import com.epmet.dto.IcResiUserConfirmDTO; import com.epmet.dto.IcResiUserDTO; import com.epmet.dto.IcVolunteerPolyDTO; @@ -278,8 +277,12 @@ public interface IcResiUserDao extends BaseDao { * @author LiuJanJun * @date 2022/2/12 3:03 下午 */ - Map getDataAnalyseCount(@Param("customerId") String customerId, @Param("tableName") String tableName, - @Param("columnList") List columnList, @Param("id") String id, @Param("level") String level); + Map getDataAnalyseCount(@Param("customerId") String customerId, + @Param("tableName") String tableName, + @Param("columnList") List columnList, + @Param("id") String id, + @Param("level") String level, + @Param("idList")List idList); List> getIcUserList(@Param("customerId") String customerId, @Param("columns") List columns); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java index de5e8ef59f..0ac72679db 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDeathService.java @@ -67,4 +67,10 @@ public interface DataSyncRecordDeathService extends BaseService ids); + + /** + * 删除居民信息时,同时删除data_sync_record_death + * @param icResiUserId + */ + void deleteByIcResiUserId(String icResiUserId); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java index b49becbc7f..4f627b589b 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/DataSyncRecordDisabilityService.java @@ -107,4 +107,10 @@ public interface DataSyncRecordDisabilityService extends BaseService allUserWarnList(StatsResiWarnFormDTO formDTO); - List list(String customerId,String id, String level); + List list(String customerId,String id, String level,List idList); List list2(StatsResiListFormDTO formDTO); diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java index e83e251478..75403760af 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/DataSyncRecordDeathServiceImpl.java @@ -155,5 +155,13 @@ public class DataSyncRecordDeathServiceImpl extends BaseServiceImpl data = cjlbOptionsMap.getData(); - return data.get(cjlb); + if(MapUtils.isNotEmpty(data)&&data.containsKey(cjlb)){ + return data.get(cjlb); + } + return StrConstant.EPMETY_STR; } @Override @@ -307,4 +326,14 @@ public class DataSyncRecordDisabilityServiceImpl extends BaseServiceImpl list(String customerId,String id, String level) { + public List list(String customerId,String id, String level,List idList) { //获取所有配置类项 getshow IcResiCategoryStatsConfigFormDTO dto = new IcResiCategoryStatsConfigFormDTO(); dto.setStatus("show"); @@ -263,7 +263,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { }); Map> tableColumnCountMap = new HashMap<>(); paramMap.forEach((tableName,columnList) ->{ - Map countMap = icResiUserDao.getDataAnalyseCount(customerId,tableName,columnList, id,level); + Map countMap = icResiUserDao.getDataAnalyseCount(customerId,tableName,columnList, id,level,idList); if (countMap != null){ tableColumnCountMap.put(tableName,countMap); } @@ -287,7 +287,7 @@ public class StatsResiWarnServiceImpl implements StatsResiWarnService { @Override public List list2(StatsResiListFormDTO formDTO) { - return list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel()); + return list(formDTO.getCustomerId(), formDTO.getId(), formDTO.getLevel(),null); } /** diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml index 67e8f18649..ad5e414ba3 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDeathDao.xml @@ -60,4 +60,10 @@ ORDER BY d.CREATED_TIME DESC + + + + delete from data_sync_record_death + where IC_RESI_USER_ID = #{icResiUserId} + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml index 1d16260551..e16d903832 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/DataSyncRecordDisabilityDao.xml @@ -215,4 +215,10 @@ + + + + delete from data_sync_record_disability + where IC_RESI_USER_ID = #{icResiUserId} + diff --git a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml index 568885f729..6a8d513121 100644 --- a/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml +++ b/epmet-user/epmet-user-server/src/main/resources/mapper/IcResiUserDao.xml @@ -819,7 +819,14 @@ AND GRID_ID = #{id} - AND VILLAGE_ID = #{id} + + AND VILLAGE_ID = #{id} + + + + VILLAGE_ID = #{id} + + AND BUILD_ID = #{id}