zqy
2024-07-07 780fa6d4016c6e616bbb4b3d29d33dbf3a40cbd6
修改bug&新加配偶接口
15个文件已修改
166 ■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/LiveStreaming.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/Meeting.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/ZSelfNote.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/domain/ZfContact.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorDownloadService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorShareService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/LiveStreamingServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteServiceImpl.java 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorDownloadServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorShareServiceImpl.java 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
@@ -148,6 +148,7 @@
        us.setRoleId(user.getRoleId());
        us.setSex(user.getSex());
        us.setStatus(user.getStatus());
        us.setRemark(user.getRemark());
        userService.updateUser(us);
  //      System.out.println(user.getFamilyId());
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java
@@ -2,6 +2,7 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mysql.cj.x.protobuf.MysqlxDatatypes;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
@@ -12,6 +13,7 @@
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZInfoUser;
import com.ruoyi.domain.ZfDoctor;
import com.ruoyi.domain.ZfRelation;
import com.ruoyi.domain.dto.Genealogy;
@@ -28,10 +30,7 @@
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.websocket.server.PathParam;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.regex.Pattern;
import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
@@ -218,15 +217,41 @@
                sex = 1;
            }
            List<ZInfoUser> zInfoUsers = zInfoUserService.getDataBySex(sex);
            List<Long> satisfyIds = new ArrayList<>();
            List<HashMap<Long,String>> satisfyIds = new ArrayList<>();
            HashMap<Long,String> bs = new HashMap<>();
            for (ZInfoUser zInfoUser:zInfoUsers) {
                if (zInfoUser.getIsMyFamily() == 1)
                    if (!zInfoUserService.findByuid(zInfoUser.getUserId(), tpfid)){
                        satisfyIds.add(zInfoUser.getUserId());
                    if (!zInfoUserService.findByuid(zInfoUser.getUserId(), tpfid) && (zInfoUser.getMaritalStatus() == null || zInfoUser.getMaritalStatus() != 1)){
                        bs.put(zInfoUser.getUserId(),zInfoUser.getNickName());
                    }
            }
            satisfyIds.add(bs);
            return AjaxResult.success(satisfyIds);
        }
    @GetMapping("/sex/{sex}")
    public AjaxResult findBySex(@PathVariable("sex")  Integer sex)
    {
//            Integer sex = zInfoUserService.getInfoById(tpfid).getSex();
        //sex == 0 -> 男
        if (sex == 1){
            sex = 0;
        }
        else if (sex == 0){
            sex = 1;
        }
        List<ZInfoUser> zInfoUsers = zInfoUserService.getDataBySex(sex);
        List<HashMap<Long,String>> satisfyIds = new ArrayList<>();
        HashMap<Long,String> bs = new HashMap<>();
        for (ZInfoUser zInfoUser:zInfoUsers) {
            if (zInfoUser.getMaritalStatus() ==null || zInfoUser.getMaritalStatus() != 1 )
                bs.put(zInfoUser.getUserId(),zInfoUser.getNickName());
        }
        satisfyIds.add(bs);
        return AjaxResult.success(satisfyIds);
    }
    /**
     * 根据用户id判断是否是异性
     */
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java
@@ -2,6 +2,8 @@
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.ServletUtils;
import com.ruoyi.domain.ShareMore;
import com.ruoyi.domain.ZfDoctor;
import com.ruoyi.domain.ZfDoctorDownload;
@@ -14,6 +16,9 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import static com.ruoyi.common.core.page.TableSupport.PAGE_NUM;
import static com.ruoyi.common.core.page.TableSupport.PAGE_SIZE;
@RestController
@RequestMapping("/ZfDoctorShare")
@@ -42,8 +47,10 @@
     */
    @PostMapping("/getInfoByUserId")
    public AjaxResult empowerGetInfo(@RequestBody ShareMore zfDoctor){
        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        return zfDoctorShareService.listByFidAid(zfDoctor);
        return zfDoctorService.selectListById(zfDoctorShareService.listByFidAid(zfDoctor),pageNum,pageSize);
    }
    /**
@@ -51,7 +58,7 @@
     */
    @GetMapping("/getInfoByShareId")
    public AjaxResult empowerGetInfo2(){
        return zfDoctorShareService.listByUserId();
        return zfDoctorShareService.listUserId();
    }
    /**
     * 根据userId和shareId收回已经授权给那些人
@@ -74,7 +81,9 @@
     */
    @GetMapping("/all")
    public List<ZfDoctor> data(ZfDoctorDownload zfDoctorDownload){
        List<ZfDoctorDownload> as = zfDoctorDownloadService.selectDoctorList(zfDoctorDownload);
        Integer pageNum = Convert.toInt(ServletUtils.getParameter(PAGE_NUM), 1);
        Integer pageSize = Convert.toInt(ServletUtils.getParameter(PAGE_SIZE), 10);
        List<ZfDoctorDownload> as = zfDoctorDownloadService.selectDoctorList(zfDoctorDownload,pageNum,pageSize);
        List<ZfDoctor> bs = new ArrayList<>();
        for (ZfDoctorDownload a: as) {
            if (zfDoctorService.getById(a.getDownloadContent()) != null) {
zhang-content/src/main/java/com/ruoyi/domain/LiveStreaming.java
@@ -89,4 +89,10 @@
    @JsonFormat(pattern = "HH:mm:ss")
    private Date time2;
    /**
     * 可容纳的最大人数
     */
    private Integer maxPerson;
}
zhang-content/src/main/java/com/ruoyi/domain/Meeting.java
@@ -76,7 +76,7 @@
    /**
     * 是否摆放水牌
     */
    @Excel(name = "是否摆放水牌")
    @Excel(name = "是否摆放水牌(1:是 0:否)")
    private Integer isPlacebrand;
    /**
     * 联系人
@@ -91,7 +91,6 @@
    /**
     * 状态
     */
    @Excel(name = "状态")
    private Integer statu;
    /**
     * 生成时间
zhang-content/src/main/java/com/ruoyi/domain/ZSelfNote.java
@@ -37,21 +37,25 @@
    /**
     * 地点
     */
    @Excel(name = "地点")
    private String address;
    /**
     * 标题
     */
    @Excel(name = "事件标题")
    private String title;
    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remark;
    /**
     * 人物
     */
    @Excel(name = "人物")
    private String people;
    /**
@@ -63,13 +67,14 @@
    /**
     * 发生时间
     */
    @Excel(name = "发生时间",dateFormat = "yyyy-MM-dd")
    @Excel(name = "时间",dateFormat = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date happenTime;
    /**
     * 电子文件路径
     */
    @Excel(name = "电子文件路径")
    private String url;
    @TableField(exist = false)
zhang-content/src/main/java/com/ruoyi/domain/ZfContact.java
@@ -31,9 +31,9 @@
    private Long id;
    /**
     * 成员姓名
     * 家人姓名
     */
    @Excel(name = "成员姓名")
    @Excel(name = "家人姓名")
    private String myName;
    /**
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorDownloadService.java
@@ -12,7 +12,7 @@
    AjaxResult deleteData(Long[] ids);
    List<ZfDoctorDownload> selectDoctorList(ZfDoctorDownload zfDoctorDownload);
    List<ZfDoctorDownload> selectDoctorList(ZfDoctorDownload zfDoctorDownload , Integer pageNum, Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorService.java
@@ -1,6 +1,7 @@
package com.ruoyi.service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfDoctor;
@@ -36,4 +37,6 @@
    AjaxResult deleteData(Long[] ids);
    AjaxResult listType();
    AjaxResult selectListById(List<Long> ids, Integer pageNum, Integer pageSize);
}
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorShareService.java
@@ -15,13 +15,13 @@
    AjaxResult saveZa(ShareMore zfDoctor);
    AjaxResult listByFidAid(ShareMore zfDoctor);
    List<Long> listByFidAid(ShareMore zfDoctorInteger);
    AjaxResult deleteZa(ShareMore zfDoctor);
    AjaxResult listByUserId();
    List<ZfDoctor> listUserId(Long shareId);
    AjaxResult listUserId();
    Long getShareId(ZfDoctorDownload zfDoctorDownload);
zhang-content/src/main/java/com/ruoyi/service/impl/LiveStreamingServiceImpl.java
@@ -100,6 +100,9 @@
        if(list.size()>0){
            throw new RuntimeException("请勿新增重复数据");
        }
        if (liveStreaming.getMaxPerson() > 120){
            throw new RuntimeException("可容纳人数暂时最多为120人");
        }
        if (save(liveStreaming)) {
            EsModel esModel = new EsModel();
@@ -111,6 +114,7 @@
            esModel.setBy1(liveStreaming.getTitle());
            esModel.setBy2(liveStreaming.getApplyPerson());
            esModel.setBy3(liveStreaming.getRoomId());
            //这里存储查询详情的路径
            esModel.setBy5("/zLiveStreaming");
//            esModel.setFid(familyId);
zhang-content/src/main/java/com/ruoyi/service/impl/ZSelfNoteServiceImpl.java
@@ -5,6 +5,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.EsModel;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
@@ -12,16 +13,15 @@
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.domain.ZSelfNote;
import com.ruoyi.mapper.ZSelfNoteMapper;
import com.ruoyi.service.EsService;
import com.ruoyi.service.ZSelfNoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import javax.annotation.Resource;
import java.util.*;
/**
 * <p>
@@ -35,7 +35,10 @@
public class ZSelfNoteServiceImpl extends ServiceImpl<ZSelfNoteMapper, ZSelfNote> implements ZSelfNoteService {
    @Autowired
    ZSelfNoteServiceImpl zSelfNoteService;
    ZSelfNoteService zSelfNoteService;
    @Resource
    private EsService esSer;
    private LambdaQueryWrapper<ZSelfNote> uniqueCondition(ZSelfNote zSelfNote) {
        LambdaQueryWrapper<ZSelfNote> lqw = new LambdaQueryWrapper<>();
@@ -137,7 +140,12 @@
        assert dataList != null;
        for (ZSelfNote zSelfNote : dataList) {
            zSelfNoteService.mySave(zSelfNote);
            if (zSelfNote.getTitle().length() != 0 && zSelfNote.getPeople().length() !=0){
                mySave(zSelfNote);}
            else {
                throw new RuntimeException("有数据的标题或人物为空");
            }
        }
        return AjaxResult.success();
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorDownloadServiceImpl.java
@@ -51,7 +51,7 @@
        return lqw;
    }
    @Override
    public List<ZfDoctorDownload> selectDoctorList(ZfDoctorDownload zfDoctorDownload) {
    public List<ZfDoctorDownload> selectDoctorList(ZfDoctorDownload zfDoctorDownload , Integer pageNum, Integer pageSize) {
        ZInfoUser myself = zInfoUserService.getMyself();
        LambdaQueryWrapper<ZfDoctorDownload> lqw = buildCondition(zfDoctorDownload,myself.getUserId());
        List<ZfDoctorDownload> beanRecords = list(lqw);
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorServiceImpl.java
@@ -439,6 +439,32 @@
        return lqw;
    }
    public LambdaQueryWrapper<ZfDoctor> buildCondition2(List<Long> ids) {
        LambdaQueryWrapper<ZfDoctor> lqw = new LambdaQueryWrapper<>();
            lqw.eq(ZfDoctor::getId, ids);
        return lqw;
    }
    @Override
    public AjaxResult selectListById(List<Long> ids, Integer pageNum, Integer pageSize) {
        List<ZfDoctor> lqw2 = new ArrayList<>();
        LambdaQueryWrapper<ZfDoctor> lqw = buildCondition2(ids);
        List<ZfDoctor> bb = list(lqw);
        System.out.println("15052222254"+bb);
        Page<ZfDoctor> zfDoctorPage = new Page<>(pageNum, pageSize);
        Page<ZfDoctor> pageResult = page(zfDoctorPage, lqw);
        List<ZfDoctor> beanRecords = pageResult.getRecords();//得到查询出来的数据
        System.out.println(beanRecords);
        HashMap<String, Object> data = MapUtils.getResult(pageResult, beanRecords);
        return AjaxResult.success(data);
//    }
//        private List<Long> buildCondition1(){
//        List<ZfDoctorShare> authority1 = zfDoctorShareService.getAuthority();
//        List<Long> idList1 = authority1.stream().filter(auth -> auth.getShareContent().toString().equals(DOCTOR_LIST)).map(ZfDoctorShare::getShareId).collect(Collectors.toList());
@@ -455,4 +481,4 @@
//    }
}
}}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorShareServiceImpl.java
@@ -1,9 +1,12 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.utils.MapUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.*;
@@ -89,10 +92,10 @@
     * 根据UserId和分享人shareId查看已经授权给那些人那些数据
     */
    @Override
    public AjaxResult listByFidAid(ShareMore zfDoctor) {
    public List<Long> listByFidAid(ShareMore zfDoctor) {
        //找到对应的赋予数据的用户以及数据内容
        Long [] shareIds = zfDoctor.getShareIds();
        List<ZfDoctor> beanRecord3 = new ArrayList<>();
        List<Long> beanRecord3 = new ArrayList<>();
        for (Long shareId : shareIds) {
            {
                LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>();
@@ -100,13 +103,12 @@
                        .eq(ZfDoctorShare::getUserId, getUserId());
                List<ZfDoctorShare> beanRecords = list(lqw);
                for (ZfDoctorShare beanRecord : beanRecords ) {
                    beanRecord3.add(zfDoctorService.getById(beanRecord.getShareContent()));
                    beanRecord3.add(beanRecord.getShareContent());
                }
            }
        }
        log.info("从数据库中查到的为:{}", beanRecord3);
        return AjaxResult.success(beanRecord3);
        return beanRecord3;
    }
    @Override
@@ -134,26 +136,28 @@
    @Override
    public AjaxResult listByUserId() {
        //找到对应的赋予数据的用户以及数据内容
        HashMap<Long,ZfDoctor>  bs = new HashMap<>();
        HashMap<Long,List<ZfDoctor>>  bs = new HashMap<>();
        LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfDoctorShare::getShareId,getUserId());
        List<ZfDoctorShare> beanRecords = list(lqw);
        List<ZfDoctor> b1 = new ArrayList<>();
        for (ZfDoctorShare beanRecord : beanRecords ) {
            bs.put(beanRecord.getUserId(),zfDoctorService.getById(beanRecord.getShareContent()));
                b1.add(zfDoctorService.getById(beanRecord.getShareContent()));
                bs.put(beanRecord.getUserId(),b1);
        }
        log.info("从数据库中查到的为:{}", bs);
        return AjaxResult.success(bs);
    }
    /**
     * 用户自己查看别人分享的数据
     * 用户自己查看别人分享的数据==用户自己查看别人分享的数据和分享人
     */
    @Override
    public List<ZfDoctor> listUserId(Long shareId) {
    public AjaxResult listUserId() {
        //找到对应的赋予数据的用户以及数据内容
        List<ZfDoctor>  bs = new ArrayList<>();
        LambdaQueryWrapper<ZfDoctorShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfDoctorShare::getShareId,shareId);
        lqw.eq(ZfDoctorShare::getShareId,getUserId());
        List<ZfDoctorShare> beanRecords = list(lqw);
        for (ZfDoctorShare beanRecord : beanRecords ) {
            ZfDoctor bs2 = zfDoctorService.getById(beanRecord.getShareContent());
@@ -161,7 +165,7 @@
            bs.add(bs2);
        }
        log.info("从数据库中查到的为:{}", bs);
        return bs;
        return AjaxResult.success(bs);
    }
    public Long getUserId(){