| | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.flowable.idm.engine.impl.persistence.entity.UserEntity; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.core.tool.utils.SpringUtil; |
| | |
| | | |
| | | @Override |
| | | public IPage<GridmanVO> selectGridmanPage(IPage<GridmanVO> page, GridmanVO gridman) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return page.setRecords(baseMapper.selectGridmanPage(page, gridman, regionChildCodesList, isAdministrator)); |
| | | CommonParamSet commonParamSet = new CommonParamSet<>().invoke(GridmanVO.class, gridman); |
| | | return page.setRecords(baseMapper.selectGridmanPage(page, gridman, commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator())); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean saveOrUpdateGridman(GridmanEntity gridman) { |
| | | boolean flag = false; |
| | | // 查询网格id |
| | | IGridService bean = SpringUtil.getBean(IGridService.class); |
| | | GridEntity gridEntity = bean.getOne(Wrappers.<GridEntity>lambdaQuery().eq(GridEntity::getGridCode, gridman.getGridCode())); |
| | | // 修改 |
| | | if (null != gridman.getId()) { |
| | | // 更新网格id |
| | | gridman.setGridId(gridEntity.getId()); |
| | | // 更新网格员信息 |
| | | flag = updateById(gridman); |
| | | } else { |
| | |
| | | wrapper.eq("is_deleted", 0).eq("account", gridman.getMobile()); |
| | | List<User> list = userService.list(wrapper); |
| | | // 更新用户,查询是否需要更新角色 |
| | | // 查询网格id |
| | | IGridService bean = SpringUtil.getBean(IGridService.class); |
| | | GridEntity gridEntity = bean.getOne(Wrappers.<GridEntity>lambdaQuery().eq(GridEntity::getGridCode, gridman.getGridCode())); |
| | | gridman.setGridId(gridEntity.getId()); |
| | | if (list.size() > 0) { |
| | | // 默认取出第一个 |