| | |
| | | //新增或修改基本信息 |
| | | @PostMapping() |
| | | public AjaxResult updateData(@RequestBody MarryInfoDto marryInfoDto){ |
| | | |
| | | System.out.println("==========="); |
| | | return marrySelfService.updateData(marryInfoDto); |
| | | } |
| | | |
| | |
| | | package com.ruoyi.web.controller.zhang; |
| | | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.ZfFamily; |
| | | import com.ruoyi.domain.dto.UserInfoDto; |
| | | import com.ruoyi.service.ZfFamilyService; |
| | | import org.springframework.security.core.parameters.P; |
| | |
| | | */ |
| | | @PostMapping() |
| | | public AjaxResult addFamilyMember(@RequestBody UserInfoDto userInfoDto){ |
| | | |
| | | return zfFamilyService.addMember(userInfoDto); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param zfFamily |
| | | * @return |
| | | */ |
| | | @PostMapping("/addFam") |
| | | public AjaxResult addFamilyMember(@RequestBody ZfFamily zfFamily){ |
| | | |
| | | return zfFamilyService.addFamily(zfFamily); |
| | | |
| | | } |
| | | /** |
| | | * |
| | | * @param zfFamily |
| | | * @return |
| | | */ |
| | | @PostMapping("/updateFam") |
| | | public AjaxResult updateFamily(@RequestBody ZfFamily zfFamily){ |
| | | |
| | | return zfFamilyService.updateFam(zfFamily); |
| | | |
| | | } |
| | | /** |
| | | * 删除家庭成员 |
| | | */ |
| | | |
| | |
| | | */ |
| | | public void insertUserRole(SysUser user) |
| | | { |
| | | |
| | | this.insertUserRole(user.getUserId(), user.getRoleIds()); |
| | | } |
| | | |
| | |
| | | |
| | | <select id="selectMenuTreeAll" resultMap="SysMenuResult"> |
| | | select distinct m.menu_id, m.parent_id, m.menu_name, m.path, m.component, m.`query`, m.visible, m.status, ifnull(m.perms,'') as perms, m.is_frame, m.is_cache, m.menu_type, m.icon, m.order_num, m.create_time |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 and m.menu_id in (1, 100,101) |
| | | from sys_menu m where m.menu_type in ('M', 'C') and m.status = 0 and m.menu_id in (1, 100,101, 118) |
| | | order by m.parent_id, m.order_num |
| | | </select> |
| | | |
| | |
| | | AjaxResult addMember(UserInfoDto userInfoDto); |
| | | |
| | | AjaxResult removeMember(UserInfoDto userInfoDto); |
| | | |
| | | |
| | | AjaxResult addFamily(ZfFamily zfFamily); |
| | | |
| | | AjaxResult updateFam(ZfFamily zfFamily); |
| | | } |
| | |
| | | //删除es中的数据 |
| | | zfPropertys.stream().forEach(zfProperty -> { |
| | | EsModel esModel = esService.findByCtId(zfProperty.getId().intValue(), "家庭资产"); |
| | | if(esModel!=null) |
| | | { |
| | | DeleteRequest deleteRequest = new DeleteRequest("allsearchdata", esModel.getId()); |
| | | try { |
| | | restHighLevelClient.delete(deleteRequest,RequestOptions.DEFAULT); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | }} |
| | | }); |
| | | return AjaxResult.success(); |
| | | }else { |
| | |
| | | // String secondFamilyIds = listSecondFamilyIds(); |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | System.out.println("================"); |
| | | |
| | | Long familyId = myself.getFamilyId(); |
| | | |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | System.out.println("++++++++++++++++"); |
| | | System.out.println(familyId); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EVENT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | | //加上自己家庭的id |
| | | idList.add(familyId); |
| | | System.out.println(idList.size()); |
| | | // String familyIds = listFamilyIds(); |
| | | // String secondFamilyAuthority = listSecondFamilyIds(); |
| | | LambdaQueryWrapper<ZfEvent> lqw = buildCondition(zfEvent, idList); |
| | |
| | | |
| | | List<ZfEvent> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | |
| | | System.out.println(beanRecords); |
| | | System.out.println(beanRecords.size()); |
| | | List<ZfEvent> dtoResult = markOwnData(familyId, beanRecords); |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, dtoResult); |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Autowired |
| | | ZInfoUserService zInfoUserService; |
| | | |
| | | @Resource |
| | | ZfFamilyMapper zfFamilyMapper; |
| | | |
| | | @Override |
| | | public ZfFamily getByName(String familyName) { |
| | |
| | | return AjaxResult.success(); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult addFamily(ZfFamily zfFamily) { |
| | | int res = zfFamilyMapper.insert(zfFamily); |
| | | return AjaxResult.success(); |
| | | } |
| | | |
| | | @Override |
| | | public AjaxResult updateFam(ZfFamily zfFamily) { |
| | | int res = zfFamilyMapper.updateById(zfFamily); |
| | | |
| | | if(res!=0) { |
| | | return AjaxResult.success(); |
| | | }else |
| | | return AjaxResult.error("修改失败,家庭号不能重复"); |
| | | } |
| | | } |
| | |
| | | public SysUserRole1 selectUserRole(Long userId) { |
| | | LambdaQueryWrapper<SysUserRole1> lqw = new LambdaQueryWrapper<>(); |
| | | lqw.eq(SysUserRole1::getUserId,userId); |
| | | return getOne(lqw); |
| | | SysUserRole1 sys = getOne(lqw); |
| | | System.out.println(sys); |
| | | return sys; |
| | | } |
| | | } |