| | |
| | | |
| | | @PostMapping("/share") |
| | | public AjaxResult share(@RequestBody ShareMore zfDoctor){ |
| | | zfDoctor.setSysMenuId(2053L); |
| | | zfDoctor.setSysMenuId(2030L); |
| | | return zHonorShareService.saveZa(zfDoctor); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/getInfoByUserId") |
| | | public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){ |
| | | zfDoctor.setSysMenuId(2053L); |
| | | zfDoctor.setSysMenuId(2030L); |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zHonorShareService.listByFidAid(zfDoctor,pageNo,pageSize) ; |
| | |
| | | */ |
| | | @PostMapping("/deleteInfoByUserId") |
| | | public AjaxResult deleteEmpower(@RequestBody ShareMore zfDoctor){ |
| | | zfDoctor.setSysMenuId(2053L); |
| | | zfDoctor.setSysMenuId(2030L); |
| | | return zHonorShareService.deleteZa(zfDoctor); |
| | | } |
| | | |
| | |
| | | */ |
| | | @PostMapping("/downloadDate") |
| | | public AjaxResult ifDownLoad(@RequestBody ZfDownload zfDownload){ |
| | | zfDownload.setSysMenuId(2053L); |
| | | zfDownload.setSysMenuId(2030L); |
| | | return zHonorDownloadService.addData(zfDownload); |
| | | } |
| | | |
| | |
| | | */ |
| | | @GetMapping("/all") |
| | | public AjaxResult data(ZfDownload zfDownload){ |
| | | zfDownload.setSysMenuId(2053L); |
| | | zfDownload.setSysMenuId(2030L); |
| | | Integer pageNo = Convert.toInt(ServletUtils.getParameter(PAGE_NO), 1); |
| | | Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10); |
| | | return zHonorDownloadService.selectDoctorList(zfDownload,pageNo ,pageSize); |
| | |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.ServletUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.common.utils.poi.ExcelUtil; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.domain.dto.AncestorClan; |
| | | import com.ruoyi.domain.dto.AncestorHelper; |
| | | import com.ruoyi.service.ZInfoUserService; |
| | | import com.ruoyi.service.ZfAncestorService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | import static com.ruoyi.common.core.domain.AjaxResult.error; |
| | | import static com.ruoyi.common.core.page.TableSupport.*; |
| | | import static jdk.nashorn.internal.runtime.regexp.joni.Config.log; |
| | | |
| | | @RestController |
| | | @RequestMapping("/ZfAncestor") |
| | |
| | | |
| | | zInfoUserService.updateById(infoUser); |
| | | } |
| | | @Log(title = "家庭大事件记录", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export") |
| | | public void export(HttpServletResponse response, ZfAncestor zfAncestor) { |
| | | List<AncestorClan> list = new ArrayList<>(); |
| | | |
| | | list = zfAncestorService.selectByCondition(zfAncestor); |
| | | // log.info("导出记录为:{}", list); |
| | | ExcelUtil<AncestorClan> util = new ExcelUtil<>(AncestorClan.class); |
| | | util.exportExcel(response, list, "家庭大事件记录数据"); |
| | | |
| | | } |
| | | /** |
| | | * 导出导出祖先信息记录列表 |
| | | */ |
| | | // @PreAuthorize("@ss.hasPermi('system:property:export')") |
| | | @Log(title = "导出祖先信息", businessType = BusinessType.EXPORT) |
| | | @PostMapping("/export1/{ids}") |
| | | public void export(HttpServletResponse response, @PathVariable Long[] ids) |
| | | { |
| | | List<AncestorClan> list = zfAncestorService.selectByIds(ids); |
| | | // log.info("导出记录为:{}",list); |
| | | ExcelUtil<AncestorClan> util = new ExcelUtil<>(AncestorClan.class); |
| | | util.exportExcel(response, list, "保洁收纳记录数据"); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改祖先信息 |
| | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | |
| | | /** |
| | | * 家族id |
| | | */ |
| | | |
| | | private Integer clanId; |
| | | |
| | | |
| | | /** |
| | | * 祖先名称 |
| | | */ |
| | | @Excel(name="祖先名称") |
| | | private String name; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 祖先性别 |
| | | */ |
| | | @Excel(name="祖先性别",readConverterExp = "0=女,1=男") |
| | | private Integer sex; |
| | | |
| | | /** |
| | | * 祖先类型 |
| | | */ |
| | | |
| | | private Integer roleId; |
| | | |
| | | /** |
| | | * 状态 |
| | | */ |
| | | @Excel(name="状态",readConverterExp = "0=在用,1=禁用") |
| | | private Integer status; |
| | | |
| | | // /** |
| | |
| | | package com.ruoyi.domain.dto; |
| | | |
| | | import com.ruoyi.common.annotation.Excel; |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | @Data |
| | | public class AncestorClan extends ZfAncestor implements Serializable { |
| | | |
| | | @Excel(name="家族名称") |
| | | private String clanName; |
| | | |
| | | |
| | | @Excel(name="类型") |
| | | private String roleName; |
| | | |
| | | |
| | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface ZfAncestorMapper extends BaseMapper<ZfAncestor> { |
| | | |
| | | @Select("select * , zf_role.name as roleName from zf_ancestor, zf_clan,zf_role where zf_ancestor.clan_id = zf_clan.clan_id and zf_ancestor.role_id = zf_role.id ${ew.customSqlSegment}") |
| | | Page<AncestorClan> selectInfo(Page page, @Param(Constants.WRAPPER) Wrapper<Object> queryWrapper); |
| | | |
| | | |
| | | @Select("select * , zf_role.name as roleName from zf_ancestor, zf_clan,zf_role where zf_ancestor.clan_id = zf_clan.clan_id and zf_ancestor.role_id = zf_role.id ${ew.customSqlSegment}") |
| | | List<AncestorClan> selectAllInfo( @Param(Constants.WRAPPER) Wrapper<Object> queryWrapper); |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.domain.dto.AncestorClan; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface ZfAncestorService extends IService<ZfAncestor> { |
| | | AjaxResult selectDataList(Integer clanId, Integer pageNo, Integer pageSize); |
| | | AjaxResult selectDataList(ZfAncestor zfAncestor, Integer pageNo, Integer pageSize); |
| | | List<AncestorClan> selectByCondition(ZfAncestor zfAncestor); |
| | | |
| | | List<AncestorClan> selectByIds(Long []ids); |
| | | |
| | | boolean count(Integer clanId); |
| | | |
| | |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.EsModel; |
| | | import com.ruoyi.common.utils.MapUtils; |
| | | import com.ruoyi.domain.ZInfoUser; |
| | | import com.ruoyi.domain.ZfAncestor; |
| | | import com.ruoyi.domain.ZfClan; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.domain.*; |
| | | import com.ruoyi.domain.dto.AncestorClan; |
| | | import com.ruoyi.mapper.ZfAncestorMapper; |
| | | import com.ruoyi.service.*; |
| | |
| | | |
| | | queryWrapper.eq(zfAncestor.getClanId() !=null , " zf_ancestor.clan_id", zfAncestor.getClanId()); |
| | | queryWrapper.eq(zfAncestor.getSysId() !=null , " zf_ancestor.sys_id ", zfAncestor.getSysId()); |
| | | queryWrapper.like(StringUtils.isNotEmpty(zfAncestor.getName()),"zf_ancestor.name",zfAncestor.getName()); |
| | | |
| | | Page<AncestorClan> info = zfAncestorMapper.selectInfo(new Page<>(pageNo, pageSize),queryWrapper); |
| | | //page(pa, wrapper); |
| | |
| | | return AjaxResult.success(data); |
| | | } |
| | | |
| | | @Override |
| | | public List<AncestorClan> selectByCondition(ZfAncestor zfAncestor) { |
| | | QueryWrapper<Object> lqw = new QueryWrapper<>(); |
| | | |
| | | lqw.like(StringUtils.isNotEmpty(zfAncestor.getName()),"zf_ancestor.name",zfAncestor.getName()); |
| | | |
| | | List<AncestorClan> lis = zfAncestorMapper.selectAllInfo(lqw); |
| | | |
| | | return lis; |
| | | } |
| | | |
| | | @Override |
| | | public List<AncestorClan> selectByIds(Long[] ids) { |
| | | List<AncestorClan> list = new ArrayList<>(); |
| | | QueryWrapper<Object> lqw = new QueryWrapper<>(); |
| | | // lqw.like(StringUtils.isNotEmpty(zfAncestor.getName()),"zf_ancestor.name",zfAncestor.getName()); |
| | | |
| | | // if(ids.length!=0) |
| | | // list = listByIds(Arrays.asList(ids)); |
| | | //else |
| | | list = zfAncestorMapper.selectAllInfo(lqw); |
| | | // System.out.println(list.size()); |
| | | // System.out.println("---------+++++++++---------"); |
| | | |
| | | List tmp = new ArrayList<>(Arrays.asList(ids)); |
| | | List res = new ArrayList(); |
| | | if(ids.length!=0) |
| | | { |
| | | for(AncestorClan ast : list) |
| | | { |
| | | if(tmp.contains(ast.getId().longValue())) |
| | | { |
| | | res.add(ast); |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | else |
| | | |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public Long addData(ZfAncestor zfAncestor) { |
| | |
| | | //要查自己家庭的 |
| | | ZInfoUser myself = zInfoUserService.getMyself(); |
| | | Long familyId = myself.getFamilyId(); |
| | | Long fatherFaId = 0L; |
| | | if(myself.getFatherId()!=null) |
| | | fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId(); |
| | | Long motherFaId = 0L; |
| | | if(myself.getMomId()!=null) |
| | | motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EQUIPMENT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | |
| | | LambdaQueryWrapper<ZfEquipment> lambdaQueryWrapper = buildCondition(zfEquipment, idList); |
| | | List<ZfEquipment> beanRecords = list(lambdaQueryWrapper); |
| | | log.info("从数据库中查到的为:{}", beanRecords); |
| | | return markOwnData(familyId, beanRecords); |
| | | return markOwnData(familyId, fatherFaId, motherFaId, beanRecords); |
| | | } |
| | | |
| | | @Override |
| | |
| | | // }).collect(Collectors.toList()); |
| | | // } |
| | | |
| | | public List<ZfEquipment> markOwnData(Long familyId,List<ZfEquipment> beanRecords){ |
| | | public List<ZfEquipment> markOwnData(Long familyId,Long fatherFamilyId, Long motherFamilyId, List<ZfEquipment> beanRecords){ |
| | | return beanRecords.stream().peek( |
| | | bean -> { |
| | | if (bean.getFamilyId() == familyId) { |
| | | if (bean.getFamilyId() == familyId ||(fatherFamilyId!=0L && fatherFamilyId==familyId)||(motherFamilyId!=0L && motherFamilyId==familyId)) { |
| | | bean.setOwnData(1); |
| | | } else { |
| | | bean.setOwnData(0); |
| | |
| | | return AjaxResult.success("您没加入到对应的家庭,请联系管理员"); |
| | | } |
| | | Long familyId = myself.getFamilyId(); |
| | | Long fatherFaId = 0L; |
| | | if(myself.getFatherId()!=null) |
| | | fatherFaId = zInfoUserService.getInfoById(myself.getFatherId()).getFamilyId(); |
| | | Long motherFaId = 0L; |
| | | if(myself.getMomId()!=null) |
| | | motherFaId = zInfoUserService.getInfoBysysId(myself.getMomId()).getFamilyId(); |
| | | //也要查别人授权的 |
| | | List<ZAuthority> authority = zAuthorityService.getAuthority(); |
| | | List<Long> idList = authority.stream().filter(auth -> auth.getAuthority().toString().equals(EQUIPMENT_LIST)).map(ZAuthority::getFid).collect(Collectors.toList()); |
| | |
| | | |
| | | List<ZfEquipment> beanRecords = pageResult.getRecords();//得到查询出来的数据 |
| | | |
| | | List<ZfEquipment> dtoResult = markOwnData(familyId, beanRecords); |
| | | List<ZfEquipment> dtoResult = markOwnData(familyId, fatherFaId, motherFaId,beanRecords); |
| | | |
| | | HashMap<String, Object> data = MapUtils.getResult(pageResult, dtoResult); |
| | | return AjaxResult.success(data); |