| | |
| | | import cn.huge.module.client.api.impl.UtilsClientImpl; |
| | | import cn.huge.module.ctrole.constant.ByRoleBaseEnum; |
| | | import cn.huge.module.ctuser.dao.mapper.CtUseroleMapper; |
| | | import cn.huge.module.ctuser.domain.po.CtUnit; |
| | | import cn.huge.module.ctuser.domain.po.CtUser; |
| | | import cn.huge.module.ctuser.domain.po.CtUserole; |
| | | import cn.huge.module.ctuser.service.CtUnitService; |
| | | import cn.huge.module.ctuser.service.CtUserService; |
| | | import cn.huge.module.ctuser.service.CtUseroleService; |
| | | import cn.huge.module.cust.constant.RoleBaseEnum; |
| | | import cn.huge.module.cust.constant.UserBaseConsts; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.google.common.collect.Maps; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private CtUseroleService ctUseroleService; |
| | | @Autowired |
| | | private CtUserService ctUserService; |
| | | @Autowired |
| | | private CtUnitService ctUnitService; |
| | | |
| | | /** |
| | | * 用户角色更新-白云角色映射为广州角色 |
| | |
| | | throw new ServiceException("ByToGzService.upBytoGzUserole", e); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 单位名称更新-白云单位名称街道办->综治中心 |
| | | */ |
| | | public void upUnitNameZzzx(){ |
| | | try{ |
| | | QueryWrapper<CtUnit> ctUnitQueryWrapper = new QueryWrapper<>(); |
| | | ctUnitQueryWrapper.eq("unit_grade", UserBaseConsts.UNIT_GRADE_3); |
| | | List<CtUnit> ctUnitList = ctUnitService.list(ctUnitQueryWrapper); |
| | | for (CtUnit ctUnit: ctUnitList){ |
| | | ctUnit.setUnitName(ctUnit.getUnitName().replace("街道办", "街综治中心")); |
| | | ctUnitService.updateById(ctUnit); |
| | | // 更新人员单位名称 |
| | | UpdateWrapper<CtUser> ctUserUpdateWrapper = new UpdateWrapper<>(); |
| | | ctUserUpdateWrapper.eq("unit_id", ctUnit.getId()).set("unit_name", ctUnit.getUnitName()); |
| | | ctUserService.update(ctUserUpdateWrapper); |
| | | } |
| | | }catch (Exception e){ |
| | | log.error("[ByToGzService.upUnitNameZzzx]调用失败,异常信息:"+e, e); |
| | | throw new ServiceException("ByToGzService.upUnitNameZzzx", e); |
| | | } |
| | | } |
| | | } |