| | |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * 查询物业人员/网格人员 |
| | | */ |
| | | @GetMapping("/getUserInfoByDistrictId") |
| | | @ApiOperation(value = "查询物业人员/网格人员", notes = "houseCode") |
| | |
| | | return R.data(userService.getUserInfoByDistrictId(districtId, building)); |
| | | } |
| | | |
| | | /** |
| | | * 处理漏绑定的user_dept |
| | | */ |
| | | @GetMapping("/handleUserDept") |
| | | public R handleUserDept() { |
| | | return R.data(userService.handleUserDept()); |
| | | } |
| | | |
| | | } |
| | |
| | | UserVO searchUserById(Long id); |
| | | |
| | | List<UserEntity> getUserInfoByDistrictId(String districtId, String building); |
| | | |
| | | /** |
| | | * 查询没有匹配的数据 |
| | | * @return |
| | | */ |
| | | List<User> getNotBindUserDept(); |
| | | } |
| | |
| | | |
| | | </select> |
| | | |
| | | <!--查询没有匹配的数据--> |
| | | <select id="getNotBindUserDept" resultType="org.springblade.modules.system.entity.User"> |
| | | select bu.* from blade_user bu |
| | | left join blade_user_dept bud on bu.id = bud.user_id |
| | | where bu.is_deleted = 0 and bud.id is null |
| | | and bu.dept_id!='' |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | List<UserEntity> getUserInfoByCode(String houseCode, String type); |
| | | |
| | | List<UserEntity> getUserInfoByDistrictId(String districtId, String building); |
| | | |
| | | /** |
| | | * 处理漏绑定的user_dept |
| | | */ |
| | | Object handleUserDept(); |
| | | } |
| | |
| | | public List<UserEntity> getUserInfoByDistrictId(String districtId, String building) { |
| | | return baseMapper.getUserInfoByDistrictId(districtId, building); |
| | | } |
| | | |
| | | /** |
| | | * 处理漏绑定的user_dept |
| | | */ |
| | | @Override |
| | | public Object handleUserDept() { |
| | | // 查询没有匹配的数据 |
| | | List<User> list = baseMapper.getNotBindUserDept(); |
| | | // 遍历处理 |
| | | for (User user : list) { |
| | | UserDept userDept = new UserDept(); |
| | | userDept.setUserId(user.getId()); |
| | | userDept.setDeptId(Long.parseLong(user.getDeptId())); |
| | | // 保存 |
| | | userDeptService.save(userDept); |
| | | } |
| | | return null; |
| | | } |
| | | } |