上传代码

hehai
jiakun.lin 4 years ago
parent afb32a4515
commit ad53b77262
  1. 32
      src/main/java/com/msdw/tms/service/impl/AchievementManagementServiceImpl.java

@ -7,10 +7,7 @@ import com.msdw.tms.common.utils.Constant;
import com.msdw.tms.common.utils.PageUtils; import com.msdw.tms.common.utils.PageUtils;
import com.msdw.tms.common.utils.R; import com.msdw.tms.common.utils.R;
import com.msdw.tms.common.utils.poi.ExcelExportUtil; import com.msdw.tms.common.utils.poi.ExcelExportUtil;
import com.msdw.tms.dao.AchievementManagementDao; import com.msdw.tms.dao.*;
import com.msdw.tms.dao.ExperimentalTeachingDao;
import com.msdw.tms.dao.ProjectRecordDao;
import com.msdw.tms.dao.UserInfoDao;
import com.msdw.tms.entity.*; import com.msdw.tms.entity.*;
import com.msdw.tms.entity.request.AchievementImportRequest; import com.msdw.tms.entity.request.AchievementImportRequest;
import com.msdw.tms.entity.request.ImportAssessmentRequest; import com.msdw.tms.entity.request.ImportAssessmentRequest;
@ -46,6 +43,9 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
@Autowired @Autowired
private UserInfoDao userInfoDao; private UserInfoDao userInfoDao;
@Autowired
private ProjectHiddenDao projectHiddenDao;
//查询实验报告 //查询实验报告
@Override @Override
@Transactional @Transactional
@ -327,6 +327,11 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
@Override @Override
public R deleteReportById(List<Integer> projectIds, Integer projectPermissions, List<Integer> ids) { public R deleteReportById(List<Integer> projectIds, Integer projectPermissions, List<Integer> ids) {
ProjectHiddenEntity projectHiddenEntity = new ProjectHiddenEntity();
//projectHiddenEntity.setId(null);
int num = 0;
if (projectPermissions == 1) {//实验教学 if (projectPermissions == 1) {//实验教学
for (Integer id : ids) { for (Integer id : ids) {
List<AchievementManagementVO> teachAchievements = achievementManagementDao.getTeachAchievement(id); List<AchievementManagementVO> teachAchievements = achievementManagementDao.getTeachAchievement(id);
@ -335,6 +340,15 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
Integer recordId = teachAchievement.getRecordId(); Integer recordId = teachAchievement.getRecordId();
achievementManagementDao.deleteReport(reportId, recordId); achievementManagementDao.deleteReport(reportId, recordId);
} }
//将教学实验隐藏
projectHiddenEntity.setTeachId(id);
projectHiddenEntity.setIsHidden(1);
num = projectHiddenDao.insert(projectHiddenEntity);
if ( num <= 0){
R.error(400,"删除失败!");
}
} }
} else { } else {
for (Integer projectId : projectIds) {//虚仿实验 for (Integer projectId : projectIds) {//虚仿实验
@ -344,6 +358,16 @@ public class AchievementManagementServiceImpl extends ServiceImpl<AchievementMan
Integer recordId = imitationAchievement.getRecordId(); Integer recordId = imitationAchievement.getRecordId();
achievementManagementDao.deleteReport(reportId, recordId); achievementManagementDao.deleteReport(reportId, recordId);
} }
//将虚仿项目隐藏
projectHiddenEntity.setProjectId(projectId);
projectHiddenEntity.setIsHidden(1);
num = projectHiddenDao.insert(projectHiddenEntity);
if ( num <= 0){
R.error(400,"删除失败!");
}
} }
} }

Loading…
Cancel
Save