Browse Source

Merge remote-tracking branch 'remotes/origin/dev_bugfix_ljj' into dev

dev
jianjun 3 years ago
parent
commit
4365364ed1
  1. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  2. 12
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java
  3. 5
      epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java
  4. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java
  5. 6
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java
  6. 2
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -734,6 +734,14 @@ public class RedisKeys {
} }
public static String getCustomerMenuList(String customerId, Integer type) { public static String getCustomerMenuList(String customerId, Integer type) {
return rootPrefix.concat("oper:access:nav:customerId:").concat(customerId).concat(":type:")+type; return getCustomerMenuListPrefix().concat(customerId).concat(":type:")+type;
}
/**
* desc:菜单缓存前缀
* @return
*/
public static String getCustomerMenuListPrefix() {
return rootPrefix.concat("oper:access:nav:customerId:");
} }
} }

12
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/redis/GovCustomerMenuRedis.java

@ -17,6 +17,7 @@
package com.epmet.redis; package com.epmet.redis;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.dto.GovMenuDTO; import com.epmet.dto.GovMenuDTO;
@ -66,16 +67,11 @@ public class GovCustomerMenuRedis {
/** /**
* desc:删除客户菜单缓存 * desc:删除客户菜单缓存
* @param customerId
* @param type
* @see com.epmet.enums.MenuTypeEnum * @see com.epmet.enums.MenuTypeEnum
*/ */
public void delCustomerMenu(String customerId, Integer type) { public void delAllCustomerMenu() {
if (checkParam(customerId, type)) { String key = RedisKeys.getCustomerMenuListPrefix().concat(StrConstant.STAR);
String key = RedisKeys.getCustomerMenuList(customerId, type); redisUtils.deleteByPattern(key);
redisUtils.delete(key);
}
} }
private boolean checkParam(String customerId, Integer type) { private boolean checkParam(String customerId, Integer type) {

5
epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/service/impl/GovCustomerMenuServiceImpl.java

@ -28,7 +28,6 @@ import com.epmet.dao.GovCustomerMenuDao;
import com.epmet.dto.GovCustomerMenuDTO; import com.epmet.dto.GovCustomerMenuDTO;
import com.epmet.dto.form.MenuConfigFormDTO; import com.epmet.dto.form.MenuConfigFormDTO;
import com.epmet.entity.GovCustomerMenuEntity; import com.epmet.entity.GovCustomerMenuEntity;
import com.epmet.enums.MenuTypeEnum;
import com.epmet.redis.GovCustomerMenuRedis; import com.epmet.redis.GovCustomerMenuRedis;
import com.epmet.service.GovCustomerMenuService; import com.epmet.service.GovCustomerMenuService;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
@ -119,8 +118,8 @@ public class GovCustomerMenuServiceImpl extends BaseServiceImpl<GovCustomerMenuD
} }
insertBatch(entities); insertBatch(entities);
} }
//删除缓存 //删除全部客户缓存
formDTO.getCustomerIds().forEach(customerId-> govCustomerMenuRedis.delCustomerMenu(customerId, MenuTypeEnum.MENU.value())); govCustomerMenuRedis.delAllCustomerMenu();
} }
@Override @Override

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/IcNeighborHoodDao.java

@ -48,7 +48,7 @@ public interface IcNeighborHoodDao extends BaseDao<IcNeighborHoodEntity> {
@Param("agencyNameList") List<String> agencyNameList, @Param("agencyNameList") List<String> agencyNameList,
@Param("gridNameList") List<String> gridNameList); @Param("gridNameList") List<String> gridNameList);
Integer checkNameUq(@Param("customerId") String customerId, Integer checkNameUq(@Param("gridId") String gridId,
@Param("neighborHoodName")String neighborHoodName, @Param("neighborHoodName")String neighborHoodName,
@Param("neighborId")String neighborId); @Param("neighborId")String neighborId);

6
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/NeighborHoodServiceImpl.java

@ -73,8 +73,8 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { public void AddNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) {
//同一客户下,小区名称唯一 //同一网格下,小区名称唯一
Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),null); Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),null);
if (null != count && count > 0) { if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg());
} }
@ -155,7 +155,7 @@ public class NeighborHoodServiceImpl implements NeighborHoodService {
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) { public void UpdateNeighborhood(String customerId, IcNeighborHoodFormDTO formDTO) {
//同一客户下,小区名称唯一 //同一客户下,小区名称唯一
Integer count = icNeighborHoodDao.checkNameUq(customerId,formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId()); Integer count = icNeighborHoodDao.checkNameUq(formDTO.getGridId(),formDTO.getNeighborHoodName(),formDTO.getNeighborHoodId());
if (null != count && count > 0) { if (null != count && count > 0) {
throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg()); throw new RenException(EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getCode(), EpmetErrorCode.NEIGHBOOR_NAME_EXITED.getMsg());
} }

2
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/IcNeighborHoodDao.xml

@ -208,7 +208,7 @@
count(*) count(*)
from ic_neighbor_hood a from ic_neighbor_hood a
where a.del_flag='0' where a.del_flag='0'
and a.customer_id=#{customerId} and a.grid_id=#{gridId}
and a.NEIGHBOR_HOOD_NAME=#{neighborHoodName} and a.NEIGHBOR_HOOD_NAME=#{neighborHoodName}
<if test=" null != neighborId and neighborId.trim() != ''"> <if test=" null != neighborId and neighborId.trim() != ''">
and a.id !=#{neighborId} and a.id !=#{neighborId}

Loading…
Cancel
Save