zqy
2024-11-10 e2e816919caa81711a5bdf6768257c4bb3a9f3af
修改
8个文件已修改
3个文件已添加
252 ■■■■■ 已修改文件
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ShareACollectionController.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/pom.xml 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/constant/MenuAuthority.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ShareACollectionService.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorDownloadService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorShareService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ShareACollectionServiceImpl.java 138 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorDownloadServiceImpl.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorShareServiceImpl.java 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ShareACollectionController.java
New file
@@ -0,0 +1,31 @@
package com.ruoyi.web.controller.zhang;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.service.ShareACollectionService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
@RestController
public class ShareACollectionController {
    @Resource
    ShareACollectionService shareACollectionService;
    /**
     * 获取我分享给别人的数据(所有模块)
     */
    @GetMapping("/share/all")
    public AjaxResult allShareByUserId(Long userId){
        return shareACollectionService.allMyShare(userId);
    }
    /**
     * 获取我下载的数据(所有模块)
     */
    @GetMapping("/collection/all")
    public AjaxResult allDownloadByUserId(Long userId){
        return shareACollectionService.allMyDownload(userId);
    }
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZInfoUserController.java
@@ -165,6 +165,21 @@
            //    saveOrUpdate(zInfoUser));
    }
    @Log(title = "个人详细信息记录", businessType = BusinessType.INSERT)
    @PutMapping("/updateInfo")
    public AjaxResult updateInfo(@RequestBody ZInfoUser zInfoUser) {
//        if (!Pattern.matches("^[\\d]+(?:,[\\d]+)*$",zInfoUser.getFamilyId())) {
//            throw new RuntimeException("请输入只有数字和英文逗号的字符串,且数字和逗号必须交替出现");
//        }
        SysUser user = SecurityUtils.getLoginUser().getUser();
        Long userId = user.getUserId();
        zInfoUser.setSysId(userId);
        //LambdaUpdateWrapper<ZInfoUser> uw = new LambdaUpdateWrapper<>();
       // uw.eq(ZInfoUser::getSysId,userId).set(ZInfoUser::getSelfIntroduction,zInfoUser.getSelfIntroduction());
        return toAjax(zInfoUserService.saveOrUpdate(zInfoUser));
        //    saveOrUpdate(zInfoUser));
    }
//    /**
//     * 修改个人详细信息记录
@@ -387,8 +402,8 @@
    }
    /**
     //     * 分享给其他家族数据,通过输入名字查找所有的同名用户和家族号
     //     */
     * 分享给其他家族数据,通过输入名字查找所有的同名用户和家族号
    */
    @PostMapping("/byName")
    public AjaxResult listByNickNameDate(@RequestBody ZInfoUser zInfoUser)
    {
ruoyi-admin/src/main/java/com/ruoyi/web/controller/zhang/ZfDoctorShareController.java
@@ -4,8 +4,7 @@
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.ZfDownload;
import com.ruoyi.domain.*;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZfDoctorDownloadService;
import com.ruoyi.service.ZfDoctorService;
@@ -14,6 +13,9 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import static com.ruoyi.common.core.page.TableSupport.*;
@RestController
zhang-content/pom.xml
@@ -81,6 +81,14 @@
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>11</source>
                    <target>11</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
zhang-content/src/main/java/com/ruoyi/constant/MenuAuthority.java
@@ -1,6 +1,6 @@
package com.ruoyi.constant;
import org.omg.CORBA.PUBLIC_MEMBER;
//import org.omg.CORBA.PUBLIC_MEMBER;
/**
 * @Author Jinquan_Ou
zhang-content/src/main/java/com/ruoyi/service/ShareACollectionService.java
New file
@@ -0,0 +1,15 @@
package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfShare;
public interface ShareACollectionService extends IService<ZfShare> {
    AjaxResult allMyDownload(Long userId);
    AjaxResult allMyShare(Long userId);
}
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorDownloadService.java
@@ -4,6 +4,8 @@
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ZfDownload;
import java.util.List;
public interface ZfDoctorDownloadService extends IService<ZfDownload> {
    AjaxResult addData(ZfDownload zfDownload);
@@ -12,5 +14,7 @@
    AjaxResult selectDoctorList(ZfDownload zfDownload, Integer pageNo , Integer pageSize);
    List<ZfDownload> getByUserId(Long userId);
}
zhang-content/src/main/java/com/ruoyi/service/ZfDoctorShareService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.ShareMore;
import com.ruoyi.domain.ZfDoctor;
import com.ruoyi.domain.ZfDownload;
import com.ruoyi.domain.ZfShare;
@@ -10,7 +11,7 @@
public interface ZfDoctorShareService extends IService<ZfShare> {
    List<ZfShare> getAuthority();
    List<ZfShare> getByUserId();
    AjaxResult saveZa(ShareMore zfDoctor);
zhang-content/src/main/java/com/ruoyi/service/impl/ShareACollectionServiceImpl.java
New file
@@ -0,0 +1,138 @@
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ZfShareMapper;
import com.ruoyi.service.*;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class ShareACollectionServiceImpl extends ServiceImpl<ZfShareMapper, ZfShare> implements ShareACollectionService {
    @Resource
    private ZfEventService zfEventService;
    @Resource
    private IZfPropertyService iZfPropertyService;
    @Resource
    private ZfEquipmentService zfEquipmentService;
    @Resource
    private ZfCollectionService zfCollectionService;
    @Resource
    private ZfDoctorService zfDoctorService;
    @Resource
    private ZfCleanService zfCleanService;
    @Resource
    private ZfContactService zfContactService;
    @Resource
    private ZfPetService zfPetService;
    @Resource
    private ZfEconomyService zfEconomyService;
    @Resource
    private ZSelfNoteService zSelfNoteService;
    @Resource
    private ZPropertyService zPropertyService;
    @Resource
    private ZIdeaService zIdeaService;
    @Resource
    private TravelCountService travelCountService;
    @Resource
    private TravelDetailService travelDetailService;
    @Resource
    private ZHonorService zHonorService;
    @Resource
    private ZSecretService zSecretService;
    @Resource
    private ZfDoctorDownloadService zfDoctorDownloadService;
    @Override
    public AjaxResult allMyDownload(Long userId) {
        List<ZfDownload> byUserId = zfDoctorDownloadService.getByUserId(userId);
        Map<Long,List<Long>> menuAconId =byUserId.stream().collect(Collectors.groupingBy(ZfDownload::getSysMenuId,Collectors.mapping(ZfDownload::getDownloadContent,Collectors.toList())));
        return AjaxResult.success(all(menuAconId));
    }
    public List<ZfShare> getByUserId(Long userId) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getUserId, userId);
        return list(lqw);
    }
    public Map<Long, Object> all(Map<Long,List<Long>> menuAconId){
        Set<Long> key = menuAconId.keySet();
        Map<Long, Object> an = new HashMap<>();
        if (key.contains(2013L))
            an.put(2013L,zfEventService.selectByIds(menuAconId.get(2013L).toArray(Long[]::new)));
        if (key.contains(2002L))
            an.put(2002L,iZfPropertyService.selectByIds(menuAconId.get(2002L).toArray(Long[]::new)));
        if (key.contains(2017L))
            an.put(2017L,zfEquipmentService.selectByIds(menuAconId.get(2017L).toArray(Long[]::new)));
        if (key.contains(2018L))
            an.put(2018L,zfCollectionService.selectByIds(menuAconId.get(2018L).toArray(Long[]::new)));
        if (key.contains(2019L))
            an.put(2019L,zfDoctorService.selectByIds(menuAconId.get(2019L).toArray(Long[]::new)));
        if (key.contains(2020L))
            an.put(2020L,zfCleanService.selectByIds(menuAconId.get(2020L).toArray(Long[]::new)));
        if (key.contains(2021L))
            an.put(2021L,zfContactService.selectByIds(menuAconId.get(2021L).toArray(Long[]::new)));
        if (key.contains(2022L))
            an.put(2022L,zfPetService.selectByIds(menuAconId.get(2022L).toArray(Long[]::new)));
        if (key.contains(2023L))
            an.put(2023L,zfEconomyService.selectByIds(menuAconId.get(2023L).toArray(Long[]::new)));
        if (key.contains(2010L))
            an.put(2010L,zSelfNoteService.selectByIds(menuAconId.get(2010L).toArray(Long[]::new)));
        if (key.contains(2026L))
            an.put(2026L,zPropertyService.selectByIds(menuAconId.get(2026L).toArray(Long[]::new)));
        if (key.contains(2027L))
            an.put(2027L,zIdeaService.selectByIds(menuAconId.get(2027L).toArray(Long[]::new)));
        if (key.contains(2030L))
            an.put(2030L,zHonorService.selectByIds(menuAconId.get(2030L).toArray(Long[]::new)));
        if (key.contains(2031L))
            an.put(2031L,zSecretService.selectByIds(menuAconId.get(2031L).toArray(Long[]::new)));
        if (key.contains(2031L))
            an.put(2031L,zSecretService.selectByIds(menuAconId.get(2031L).toArray(Long[]::new)));
        if (key.contains(2056L)) {
            List<TravelCount> travelCounts = new ArrayList<>();
            for (Long id : menuAconId.get(2056L)) {
                travelCounts.add(travelCountService.getById(id));
            }
            an.put(2056L,travelCounts);
        }
        if (key.contains(2055L)) {
            List<TravelDetail> travelDetails = new ArrayList<>();
            for (Long id : menuAconId.get(2055L)) {
                travelDetails.add(travelDetailService.getById(id));
            }
            an.put(2055L,travelDetails.stream().collect(Collectors.groupingBy(TravelDetail::getCid)));
        }
        return an;
    }
    @Override
    public AjaxResult allMyShare(Long userId) {
        Map<Long,List<Long>> menuAconId = getByUserId(userId).stream().collect(Collectors.groupingBy(ZfShare::getSysMenuId,Collectors.mapping(ZfShare::getShareContent,Collectors.toList())));
        return AjaxResult.success(all(menuAconId));
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorDownloadServiceImpl.java
@@ -10,6 +10,7 @@
import com.ruoyi.domain.ZInfoUser;
import com.ruoyi.domain.ZfDoctor;
import com.ruoyi.domain.ZfDownload;
import com.ruoyi.domain.ZfShare;
import com.ruoyi.mapper.ZfDownloadMapper;
import com.ruoyi.service.*;
import org.elasticsearch.action.delete.DeleteRequest;
@@ -154,4 +155,11 @@
        ZInfoUser myself = zInfoUserService.getMyself();
        return myself.getUserId();
    }
    @Override
    public List<ZfDownload> getByUserId(Long userId) {
        LambdaQueryWrapper<ZfDownload> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfDownload::getDownloadId, userId);
        return list(lqw);
    }
}
zhang-content/src/main/java/com/ruoyi/service/impl/ZfDoctorShareServiceImpl.java
@@ -11,10 +11,7 @@
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ZfShareMapper;
import com.ruoyi.service.EsService;
import com.ruoyi.service.ZInfoUserService;
import com.ruoyi.service.ZfDoctorService;
import com.ruoyi.service.ZfDoctorShareService;
import com.ruoyi.service.*;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.delete.DeleteRequest;
import org.elasticsearch.client.RequestOptions;
@@ -23,12 +20,12 @@
import javax.annotation.Resource;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static com.alibaba.druid.sql.PagerUtils.limit;
import static com.ruoyi.constant.MenuAuthority.DOCTOR_LIST_UPDATE;
@Slf4j
@Service
@@ -45,6 +42,9 @@
    @Resource
    EsService esService;
    @Resource
    private ZfEventService zfEventService;
    private LambdaQueryWrapper<ZfShare> uniqueCondition(ZfShare zfShare) {
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
@@ -57,12 +57,12 @@
    @Override
    public List<ZfShare> getAuthority() {
    public List<ZfShare> getByUserId() {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        Long userId = user.getUserId();
        LambdaQueryWrapper<ZfShare> lqw = new LambdaQueryWrapper<>();
        lqw.eq(ZfShare::getShareId,userId);
        lqw.eq(ZfShare::getUserId,userId);
        return list(lqw);
    }