fix:项目任务达成统计新增工位和学科多选筛选 & 文件每日操作统计新增项目号筛选

This commit is contained in:
2026-03-27 15:57:04 +08:00
parent 3eefa592b1
commit 11b509872e
12 changed files with 233 additions and 63 deletions

View File

@@ -319,4 +319,13 @@ public class SimulationTaskController implements ISimulationTaskFeignClient {
return taskService.mergeQueryNode(req);
}
/**
* 根据tag1列表获取对应的任务uuid列表
*/
@GetMapping("/getUuidsByTag1s")
@Operation(summary = "根据tag1获取任务uuid列表", description = "根据tag1(项目uuid)列表获取对应的任务uuid列表")
public SdmResponse<List<String>> getUuidsByTag1s(@RequestParam(value = "tag1s") String tag1s) {
return SdmResponse.success(simulationTaskService.getUuidsByTag1s(tag1s));
}
}

View File

@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.util.List;
/**
* 任务 完成情况统计请求参数(工位、学科)
*/
@@ -48,4 +50,17 @@ public class TaskCompleteStatisticsReq {
@Schema(description = "标签10")
private String tag10;
// 以下为解析后的List字段支持逗号分隔的多个值
// 注意tag6 用于过滤 discipline 列,所以不需要单独的 tag6List
private List<String> tag1List;
private List<String> tag2List;
private List<String> tag3List;
private List<String> tag4List;
private List<String> tag5List;
private List<String> tag7List;
private List<String> tag8List;
private List<String> tag9List;
private List<String> tag10List;
private List<String> disciplineList;
}

View File

@@ -27,4 +27,11 @@ public interface ISimulationTaskService extends IService<SimulationTask> {
void batchCreateTaskFromDemand(List<SimulationDemand> demandList, Boolean isDownloadFlag, Map<String,String> fileNameMap);
/**
* 根据tag1列表获取对应的任务uuid列表
* @param tag1s tag1列表(逗号分隔)
* @return 任务uuid列表
*/
List<String> getUuidsByTag1s(String tag1s);
}

View File

@@ -701,4 +701,17 @@ public class SimulationTaskServiceImpl extends ServiceImpl<SimulationTaskMapper,
}
}
@Override
public List<String> getUuidsByTag1s(String tag1s) {
if (StringUtils.isBlank(tag1s)) {
return Collections.emptyList();
}
List<String> tag1List = Arrays.asList(tag1s.split(","));
LambdaQueryWrapper<SimulationTask> wrapper = new LambdaQueryWrapper<>();
wrapper.in(SimulationTask::getTag1, tag1List);
wrapper.select(SimulationTask::getUuid);
List<SimulationTask> tasks = this.list(wrapper);
return tasks.stream().map(SimulationTask::getUuid).collect(Collectors.toList());
}
}

View File

@@ -4029,6 +4029,47 @@ public class TaskServiceImpl implements ITaskService {
@Override
public SdmResponse getTaskAchieveStatistics(TaskCompleteStatisticsReq req) {
// 处理 discipline 和 tag1-tag10 字段,支持逗号分隔的多个值
// 注意tag6 用于过滤 discipline 列,所以将 tag6 和 discipline 合并到 disciplineList
List<String> disciplineList = new ArrayList<>();
if (StringUtils.isNotBlank(req.getDiscipline())) {
disciplineList.addAll(Arrays.asList(req.getDiscipline().split(",")));
}
if (StringUtils.isNotBlank(req.getTag6())) {
disciplineList.addAll(Arrays.asList(req.getTag6().split(",")));
}
if (!disciplineList.isEmpty()) {
req.setDisciplineList(disciplineList);
}
if (StringUtils.isNotBlank(req.getTag1())) {
req.setTag1List(Arrays.asList(req.getTag1().split(",")));
}
if (StringUtils.isNotBlank(req.getTag2())) {
req.setTag2List(Arrays.asList(req.getTag2().split(",")));
}
if (StringUtils.isNotBlank(req.getTag3())) {
req.setTag3List(Arrays.asList(req.getTag3().split(",")));
}
if (StringUtils.isNotBlank(req.getTag4())) {
req.setTag4List(Arrays.asList(req.getTag4().split(",")));
}
if (StringUtils.isNotBlank(req.getTag5())) {
req.setTag5List(Arrays.asList(req.getTag5().split(",")));
}
if (StringUtils.isNotBlank(req.getTag7())) {
req.setTag7List(Arrays.asList(req.getTag7().split(",")));
}
if (StringUtils.isNotBlank(req.getTag8())) {
req.setTag8List(Arrays.asList(req.getTag8().split(",")));
}
if (StringUtils.isNotBlank(req.getTag9())) {
req.setTag9List(Arrays.asList(req.getTag9().split(",")));
}
if (StringUtils.isNotBlank(req.getTag10())) {
req.setTag10List(Arrays.asList(req.getTag10().split(",")));
}
// 所有任务达成状态
Set<String> allAchieveStatus = new HashSet<>();
Long userId = ThreadLocalContext.getUserId();

View File

@@ -695,45 +695,65 @@
stm.user_id = #{userId}
AND task.tenant_id = #{tenantId}
AND task.exe_status is not null
<if test="req.tag1 != null and req.tag1 !='' ">
<bind name="searchKey1" value="'%' + req.tag1 + '%'"/>
and task.tag1 like #{searchKey1}
<if test="req.tag1List != null and req.tag1List.size() > 0">
and task.tag1 in
<foreach collection="req.tag1List" item="tag1Item" open="(" separator="," close=")">
#{tag1Item}
</foreach>
</if>
<if test="req.tag2 != null and req.tag2 !='' ">
<bind name="searchKey2" value="'%' + req.tag2 + '%'"/>
and task.tag2 like #{searchKey2}
<if test="req.tag2List != null and req.tag2List.size() > 0">
and task.tag2 in
<foreach collection="req.tag2List" item="tag2Item" open="(" separator="," close=")">
#{tag2Item}
</foreach>
</if>
<if test="req.tag3 != null and req.tag3 !='' ">
<bind name="searchKey3" value="'%' + req.tag3 + '%'"/>
and task.tag3 like #{searchKey3}
<if test="req.tag3List != null and req.tag3List.size() > 0">
and task.tag3 in
<foreach collection="req.tag3List" item="tag3Item" open="(" separator="," close=")">
#{tag3Item}
</foreach>
</if>
<if test="req.tag4 != null and req.tag4 !='' ">
<bind name="searchKey4" value="'%' + req.tag4 + '%'"/>
and task.tag4 like #{searchKey4}
<if test="req.tag4List != null and req.tag4List.size() > 0">
and task.tag4 in
<foreach collection="req.tag4List" item="tag4Item" open="(" separator="," close=")">
#{tag4Item}
</foreach>
</if>
<if test="req.tag5 != null and req.tag5 !='' ">
<bind name="searchKey5" value="'%' + req.tag5 + '%'"/>
and task.tag5 like #{searchKey5}
<if test="req.tag5List != null and req.tag5List.size() > 0">
and task.tag5 in
<foreach collection="req.tag5List" item="tag5Item" open="(" separator="," close=")">
#{tag5Item}
</foreach>
</if>
<if test="req.tag6 != null and req.tag6 !='' ">
<bind name="searchKey6" value="'%' + req.tag6 + '%'"/>
and task.discipline like #{searchKey6}
<if test="req.disciplineList != null and req.disciplineList.size() > 0">
and task.discipline in
<foreach collection="req.disciplineList" item="disciplineItem" open="(" separator="," close=")">
#{disciplineItem}
</foreach>
</if>
<if test="req.tag7 != null and req.tag7 !='' ">
<bind name="searchKey7" value="'%' + req.tag7 + '%'"/>
and task.tag7 like #{searchKey7}
<if test="req.tag7List != null and req.tag7List.size() > 0">
and task.tag7 in
<foreach collection="req.tag7List" item="tag7Item" open="(" separator="," close=")">
#{tag7Item}
</foreach>
</if>
<if test="req.tag8 != null and req.tag8 !='' ">
<bind name="searchKey8" value="'%' + req.tag8 + '%'"/>
and task.tag8 like #{searchKey8}
<if test="req.tag8List != null and req.tag8List.size() > 0">
and task.tag8 in
<foreach collection="req.tag8List" item="tag8Item" open="(" separator="," close=")">
#{tag8Item}
</foreach>
</if>
<if test="req.tag9 != null and req.tag9 !='' ">
<bind name="searchKey9" value="'%' + req.tag9 + '%'"/>
and task.tag9 like #{searchKey9}
<if test="req.tag9List != null and req.tag9List.size() > 0">
and task.tag9 in
<foreach collection="req.tag9List" item="tag9Item" open="(" separator="," close=")">
#{tag9Item}
</foreach>
</if>
<if test="req.tag10 != null and req.tag10 !='' ">
<bind name="searchKey10" value="'%' + req.tag10 + '%'"/>
and task.tag10 like #{searchKey10}
<if test="req.tag10List != null and req.tag10List.size() > 0">
and task.tag10 in
<foreach collection="req.tag10List" item="tag10Item" open="(" separator="," close=")">
#{tag10Item}
</foreach>
</if>
</where>
@@ -748,45 +768,65 @@
snm.user_id = #{userId}
AND task.tenant_id = #{tenantId}
AND task.exe_status is not null
<if test="req.tag1 != null and req.tag1 !='' ">
<bind name="searchKey1" value="'%' + req.tag1 + '%'"/>
and task.tag1 like #{searchKey1}
<if test="req.tag1List != null and req.tag1List.size() > 0">
and task.tag1 in
<foreach collection="req.tag1List" item="tag1Item" open="(" separator="," close=")">
#{tag1Item}
</foreach>
</if>
<if test="req.tag2 != null and req.tag2 !='' ">
<bind name="searchKey2" value="'%' + req.tag2 + '%'"/>
and task.tag2 like #{searchKey2}
<if test="req.tag2List != null and req.tag2List.size() > 0">
and task.tag2 in
<foreach collection="req.tag2List" item="tag2Item" open="(" separator="," close=")">
#{tag2Item}
</foreach>
</if>
<if test="req.tag3 != null and req.tag3 !='' ">
<bind name="searchKey3" value="'%' + req.tag3 + '%'"/>
and task.tag3 like #{searchKey3}
<if test="req.tag3List != null and req.tag3List.size() > 0">
and task.tag3 in
<foreach collection="req.tag3List" item="tag3Item" open="(" separator="," close=")">
#{tag3Item}
</foreach>
</if>
<if test="req.tag4 != null and req.tag4 !='' ">
<bind name="searchKey4" value="'%' + req.tag4 + '%'"/>
and task.tag4 like #{searchKey4}
<if test="req.tag4List != null and req.tag4List.size() > 0">
and task.tag4 in
<foreach collection="req.tag4List" item="tag4Item" open="(" separator="," close=")">
#{tag4Item}
</foreach>
</if>
<if test="req.tag5 != null and req.tag5 !='' ">
<bind name="searchKey5" value="'%' + req.tag5 + '%'"/>
and task.tag5 like #{searchKey5}
<if test="req.tag5List != null and req.tag5List.size() > 0">
and task.tag5 in
<foreach collection="req.tag5List" item="tag5Item" open="(" separator="," close=")">
#{tag5Item}
</foreach>
</if>
<if test="req.tag6 != null and req.tag6 !='' ">
<bind name="searchKey6" value="'%' + req.tag6 + '%'"/>
and task.discipline like #{searchKey6}
<if test="req.disciplineList != null and req.disciplineList.size() > 0">
and task.discipline in
<foreach collection="req.disciplineList" item="disciplineItem" open="(" separator="," close=")">
#{disciplineItem}
</foreach>
</if>
<if test="req.tag7 != null and req.tag7 !='' ">
<bind name="searchKey7" value="'%' + req.tag7 + '%'"/>
and task.tag7 like #{searchKey7}
<if test="req.tag7List != null and req.tag7List.size() > 0">
and task.tag7 in
<foreach collection="req.tag7List" item="tag7Item" open="(" separator="," close=")">
#{tag7Item}
</foreach>
</if>
<if test="req.tag8 != null and req.tag8 !='' ">
<bind name="searchKey8" value="'%' + req.tag8 + '%'"/>
and task.tag8 like #{searchKey8}
<if test="req.tag8List != null and req.tag8List.size() > 0">
and task.tag8 in
<foreach collection="req.tag8List" item="tag8Item" open="(" separator="," close=")">
#{tag8Item}
</foreach>
</if>
<if test="req.tag9 != null and req.tag9 !='' ">
<bind name="searchKey9" value="'%' + req.tag9 + '%'"/>
and task.tag9 like #{searchKey9}
<if test="req.tag9List != null and req.tag9List.size() > 0">
and task.tag9 in
<foreach collection="req.tag9List" item="tag9Item" open="(" separator="," close=")">
#{tag9Item}
</foreach>
</if>
<if test="req.tag10 != null and req.tag10 !='' ">
<bind name="searchKey10" value="'%' + req.tag10 + '%'"/>
and task.tag10 like #{searchKey10}
<if test="req.tag10List != null and req.tag10List.size() > 0">
and task.tag10 in
<foreach collection="req.tag10List" item="tag10Item" open="(" separator="," close=")">
#{tag10Item}
</foreach>
</if>
</where>
</select>