|
@@ -5,6 +5,7 @@ import cn.hutool.core.util.ArrayUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.TypeReference;
|
|
import com.alibaba.fastjson.TypeReference;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -2675,5 +2676,22 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
cwProjectReportSignatureMapper.updateById(item); // 将修改的数据保存
|
|
cwProjectReportSignatureMapper.updateById(item); // 将修改的数据保存
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ // 删除已盖章的附件
|
|
|
|
+ // 1. 查询到当前报告的附件
|
|
|
|
+ List<WorkAttachment> workAttachments = ossServiceMapper.selectList(new LambdaQueryWrapper<WorkAttachment>().eq(WorkAttachment::getAttachmentId, reportId));
|
|
|
|
+ // 2. 查询哪些附件是已盖章的
|
|
|
|
+ List<String> delIds = new ArrayList<>();
|
|
|
|
+ workAttachments.stream().forEach(item -> {
|
|
|
|
+ int i = reportMapper.checkIsSign(item.getId());
|
|
|
|
+ if (i != 0) {
|
|
|
|
+ delIds.add(item.getId());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ // 3. 删除已盖章的附件(报告签章附件关联表 cw_project_report_file)
|
|
|
|
+ workAttachments.stream().forEach(item -> {
|
|
|
|
+ reportMapper.deleteIsSign(item.getId()); // 物理删除
|
|
|
|
+ });
|
|
|
|
+ // 4. 删除已盖章的附件(附件表 work_attachment)
|
|
|
|
+ ossServiceMapper.deleteBatchIds(delIds); // 逻辑删除
|
|
}
|
|
}
|
|
}
|
|
}
|