fix:回滚数据统计-任务达成统计代码

This commit is contained in:
2026-04-02 10:01:36 +08:00
parent 0a007200f0
commit 76f8cc7c3a
2 changed files with 60 additions and 141 deletions

View File

@@ -4044,47 +4044,6 @@ public class TaskServiceImpl implements ITaskService {
@Override @Override
public SdmResponse getTaskAchieveStatistics(TaskCompleteStatisticsReq req) { 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<>(); Set<String> allAchieveStatus = new HashSet<>();
Long userId = ThreadLocalContext.getUserId(); Long userId = ThreadLocalContext.getUserId();

View File

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