Browse Source

BUG修复

wangliang 3 years ago
parent
commit
6891f0c26d

+ 2 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/TCStatisticsService.java

@@ -76,10 +76,11 @@ public interface TCStatisticsService extends IService<TCStatistics> {
     /**
      * 删除导入数据
      *
+     * @param userId
      * @param courseSet
      * @param setCollections
      */
-    public void removeImportData(Set<String> courseSet, Set<Long>... setCollections);
+    public void removeImportData(Long userId, Set<String> courseSet, Set<Long>... setCollections);
 
     /**
      * 刷新关联数据

+ 6 - 3
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/TCStatisticsServiceImpl.java

@@ -117,25 +117,28 @@ public class TCStatisticsServiceImpl extends ServiceImpl<TCStatisticsMapper, TCS
     /**
      * 删除导入数据
      *
+     * @param userId
      * @param courseSet
      * @param setCollections
      */
     @Override
     @Transactional
-    public void removeImportData(Set<String> courseSet, Set<Long>... setCollections) {
+    public void removeImportData(Long userId, Set<String> courseSet, Set<Long>... setCollections) {
         TCStatisticsService tcStatisticsService = SpringContextHolder.getBean(TCStatisticsService.class);
         QueryWrapper<TCStatistics> tcStatisticsQueryWrapper = new QueryWrapper<>();
         tcStatisticsQueryWrapper.lambda().in(TCStatistics::getCollegeId, setCollections[0])
                 .in(TCStatistics::getTeachingRoomId, setCollections[1])
                 .in(TCStatistics::getCourseCode, courseSet)
-                .in(TCStatistics::getClazzId, setCollections[2]);
+                .in(TCStatistics::getClazzId, setCollections[2])
+                .eq(TCStatistics::getCreateId, userId);
         tcStatisticsService.remove(tcStatisticsQueryWrapper);
 
         QueryWrapper<TCStatisticsTemp> tcStatisticsTempQueryWrapper = new QueryWrapper<>();
         tcStatisticsTempQueryWrapper.lambda().in(TCStatisticsTemp::getCollegeId, setCollections[0])
                 .in(TCStatisticsTemp::getTeachingRoomId, setCollections[1])
                 .in(TCStatisticsTemp::getCourseCode, courseSet)
-                .in(TCStatisticsTemp::getClazzId, setCollections[2]);
+                .in(TCStatisticsTemp::getClazzId, setCollections[2])
+                .eq(TCStatisticsTemp::getCreateId, userId);
         tcStatisticsTempService.remove(tcStatisticsTempQueryWrapper);
     }
 

+ 1 - 1
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -1383,7 +1383,7 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                 throw ExceptionResultEnum.ERROR.exception(JSONObject.toJSONString(errors));
             }
             //加入删除
-            tcStatisticsService.removeImportData(courseSet, collegeIdSet, teachingRoomIdSet, ClazzIdSet);
+            tcStatisticsService.removeImportData(sysUser.getId(), courseSet, collegeIdSet, teachingRoomIdSet, ClazzIdSet);
             tcStatisticsTempService.saveBatch(tcStatisticsImportTempList);
             map.put("dataCount", tcStatisticsImportTempList.size());
             tcStatisticsService.importJoinData(sysUser, batchNo);