Browse Source

更新居民的网格id 是小区修改所属网格触发

dev
jianjun 3 years ago
parent
commit
ed89bff32e
  1. 2
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java
  2. 3
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java
  3. 19
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

2
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/NeighborHoodController.java

@ -99,7 +99,7 @@ public class NeighborHoodController {
lock = distributedLock.getLock(RedisKeys.getXiaoquEditLock(tokenDTO.getCustomerId()), 120L, 3L, TimeUnit.SECONDS);
neighborHoodService.updateNeighborhood(customerId,formDTO);
} finally {
lock.unlock();
distributedLock.unLock(lock);
}
return new Result();
}

3
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/IcResiUserController.java

@ -49,7 +49,6 @@ import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.*;
import com.epmet.commons.tools.utils.poi.excel.handler.FreezeAndFilter;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.OrgInfoConstant;
import com.epmet.constant.SystemMessageType;
import com.epmet.constants.ImportTaskConstants;
import com.epmet.dto.IcResiUserDTO;
@ -261,7 +260,7 @@ public class IcResiUserController implements ResultDataResolver {
this.sendVolunteerMsg(tokenDto.getCustomerId(), resiUserId);
} finally {
lock.unlock();
distributedLock.unLock(lock);
}
return new Result();
}

19
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/IcResiUserServiceImpl.java

@ -79,7 +79,6 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.NotNull;
import org.redisson.api.RLock;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;
@ -2213,9 +2212,21 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
return listPage.getResult();
}
@Transactional(rollbackFor = Exception.class)
@Override
public List<String> changeIcResiUserBelongTo(TokenDto tokenDto, IcUserBelongToChangedFormDTO formDTO) {
List<String> resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(), formDTO.getSourceGridId());
if (StringUtils.isBlank(formDTO.getCustomerId())||
StringUtils.isBlank(formDTO.getSourceGridId())||StringUtils.isBlank(formDTO.getTargetGridId()){
throw new EpmetException(EpmetErrorCode.EPMET_COMMON_OPERATION_FAIL.getCode(),"参数错误","参数错误");
}
IcResiUserEntity entity = new IcResiUserEntity();
entity.setGridId(formDTO.getTargetGridId());
LambdaQueryWrapper<IcResiUserEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(IcResiUserEntity::getGridId,formDTO.getSourceGridId());
baseDao.update(entity,wrapper);
//不调用原来的更新居民了 太慢
/*List<String> resiUserIdList = baseDao.listUserIds(formDTO.getCustomerId(), formDTO.getSourceGridId());
if (CollectionUtils.isEmpty(resiUserIdList)) {
return null;
}
@ -2234,8 +2245,8 @@ public class IcResiUserServiceImpl extends BaseServiceImpl<IcResiUserDao, IcResi
map.put(FieldConstant.ID, userId);
this.edit(tokenDto, icResiUserFormDTOS);
});
return resiUserIdList;
*/
return null;
}
/**

Loading…
Cancel
Save