123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- package com.fdkankan.fusion.service.impl;
- import cn.dev33.satoken.stp.StpUtil;
- import cn.hutool.core.date.DateUtil;
- import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
- import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
- import com.fdkankan.fusion.common.util.UploadToOssUtil;
- import com.fdkankan.fusion.entity.CaseFiles;
- import com.fdkankan.fusion.entity.CaseOverview;
- import com.fdkankan.fusion.entity.CaseTabulation;
- import com.fdkankan.fusion.httpClient.client.FdKKClient;
- import com.fdkankan.fusion.httpClient.request.AddMediaLibraryParam;
- import com.fdkankan.fusion.mapper.ICaseTabulationMapper;
- import com.fdkankan.fusion.request.ExportOverviewParam;
- import com.fdkankan.fusion.service.ICaseFilesService;
- import com.fdkankan.fusion.service.ICaseOverviewService;
- import com.fdkankan.fusion.service.ICaseTabulationService;
- import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
- import org.apache.commons.lang3.StringUtils;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.stereotype.Service;
- import java.util.Date;
- import java.util.List;
- /**
- * <p>
- * 服务实现类
- * </p>
- *
- * @author
- * @since 2025-05-13
- */
- @Service
- public class CaseTabulationServiceImpl extends ServiceImpl<ICaseTabulationMapper, CaseTabulation> implements ICaseTabulationService {
- @Autowired
- ICaseFilesService caseFilesService;
- @Autowired
- ICaseOverviewService caseOverviewService;
- @Autowired
- FdKKClient fdKKClient;
- @Autowired
- UploadToOssUtil uploadToOssUtil;
- @Override
- public List<CaseTabulation> getByCaseId(String caseId) {
- LambdaQueryWrapper<CaseTabulation> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(CaseTabulation::getCaseId,caseId);
- wrapper.orderByDesc(CaseTabulation::getId);
- return this.list(wrapper);
- }
- @Override
- public List<CaseTabulation> getByOverviewId(String overviewId) {
- LambdaQueryWrapper<CaseTabulation> wrapper = new LambdaQueryWrapper<>();
- wrapper.eq(CaseTabulation::getOverviewId,overviewId);
- wrapper.orderByDesc(CaseTabulation::getId);
- return this.list(wrapper);
- }
- @Override
- public void addOrUpdate(CaseTabulation caseTabulation) {
- this.saveOrUpdate(caseTabulation);
- caseTabulation = this.getById(caseTabulation.getId());
- if(StringUtils.isNotBlank(caseTabulation.getTitle()) && caseTabulation.getOverviewId() != null){
- caseOverviewService.updateTitleById(caseTabulation.getOverviewId(),caseTabulation.getTitle());
- }
- if(StringUtils.isNotBlank(caseTabulation.getListCover()) && caseTabulation.getOverviewId() != null){
- caseOverviewService.updateListCoverById(caseTabulation.getOverviewId(),caseTabulation.getListCover());
- }
- caseFilesService.addOrUpdateOver(caseTabulation);
- }
- @Override
- public void updateTitleById(Integer tabulationId, String filesTitle) {
- LambdaUpdateWrapper<CaseTabulation> wrapper = new LambdaUpdateWrapper<>();
- wrapper.eq(CaseTabulation::getId,tabulationId);
- wrapper.set(CaseTabulation::getTitle,filesTitle);
- this.update(wrapper);
- }
- @Override
- public void updateCaseByOverIds(List<Integer> overviewIds, Integer caseId) {
- LambdaUpdateWrapper<CaseTabulation> wrapper = new LambdaUpdateWrapper<>();
- wrapper.in(CaseTabulation::getOverviewId,overviewIds);
- wrapper.set(CaseTabulation::getCaseId,caseId);
- this.update(wrapper);
- }
- @Override
- public void updateCaseByIds(List<Integer> tabulationIds, Integer caseId) {
- LambdaUpdateWrapper<CaseTabulation> wrapper = new LambdaUpdateWrapper<>();
- wrapper.in(CaseTabulation::getId,tabulationIds);
- wrapper.set(CaseTabulation::getCaseId,caseId);
- this.update(wrapper);
- }
- @Override
- public Long getNo(Long sysUserId) {
- LambdaUpdateWrapper<CaseTabulation> wrapper = new LambdaUpdateWrapper<>();
- wrapper.eq(CaseTabulation::getSysUserId,sysUserId);
- return this.count(wrapper);
- }
- }
|