|
@@ -5,6 +5,7 @@ import cn.com.qmth.stmms.ms.admin.dto.WorkOverview;
|
|
import cn.com.qmth.stmms.ms.admin.service.WorkService;
|
|
import cn.com.qmth.stmms.ms.admin.service.WorkService;
|
|
import cn.com.qmth.stmms.ms.commons.utils.RandomUtil;
|
|
import cn.com.qmth.stmms.ms.commons.utils.RandomUtil;
|
|
import cn.com.qmth.stmms.ms.core.domain.Level;
|
|
import cn.com.qmth.stmms.ms.core.domain.Level;
|
|
|
|
+import cn.com.qmth.stmms.ms.core.domain.MarkStage;
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkSubject;
|
|
import cn.com.qmth.stmms.ms.core.domain.MarkSubject;
|
|
import cn.com.qmth.stmms.ms.core.domain.Work;
|
|
import cn.com.qmth.stmms.ms.core.domain.Work;
|
|
import cn.com.qmth.stmms.ms.core.repository.*;
|
|
import cn.com.qmth.stmms.ms.core.repository.*;
|
|
@@ -51,6 +52,9 @@ public class WorkApi {
|
|
@Autowired
|
|
@Autowired
|
|
private MarkSubjectRepo markSubjectRepo;
|
|
private MarkSubjectRepo markSubjectRepo;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private MarkTaskRepo markTaskRepo;
|
|
|
|
+
|
|
@Autowired
|
|
@Autowired
|
|
RandomUtil randomUtil;
|
|
RandomUtil randomUtil;
|
|
|
|
|
|
@@ -76,6 +80,8 @@ public class WorkApi {
|
|
if (work.isActive()) {
|
|
if (work.isActive()) {
|
|
randomUtil.getRandom(work.getId(), false);
|
|
randomUtil.getRandom(work.getId(), false);
|
|
}
|
|
}
|
|
|
|
+ int count = markTaskRepo.countByWorkIdAndStageAndResultNotNull(work.getId(), MarkStage.LEVEL);
|
|
|
|
+ work.setModifyOtherVal(count == 0);
|
|
return work;
|
|
return work;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -101,11 +107,11 @@ public class WorkApi {
|
|
@Transactional
|
|
@Transactional
|
|
@RequestMapping(value = "{workId}", method = RequestMethod.PUT)
|
|
@RequestMapping(value = "{workId}", method = RequestMethod.PUT)
|
|
public Work update(@PathVariable Long workId, @RequestBody Work work) {
|
|
public Work update(@PathVariable Long workId, @RequestBody Work work) {
|
|
- List<MarkSubject> subjects = markSubjectRepo.findAllByWorkId(workId);
|
|
|
|
|
|
+ /*List<MarkSubject> subjects = markSubjectRepo.findAllByWorkId(workId);
|
|
long count = subjects.stream().filter(m->m.getStage().ordinal() != 0).count();
|
|
long count = subjects.stream().filter(m->m.getStage().ordinal() != 0).count();
|
|
if(count > 0){
|
|
if(count > 0){
|
|
throw new RuntimeException("档位参数只能采集阶段修改");
|
|
throw new RuntimeException("档位参数只能采集阶段修改");
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
|
|
levelRepo.deleteByWorkId(work.getId());
|
|
levelRepo.deleteByWorkId(work.getId());
|
|
|
|
|