|
@@ -1,5 +1,6 @@
|
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.date.DateUnit;
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
@@ -392,26 +393,45 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
|
|
|
return R.error("该作业已发布,不能调整开工时间");
|
|
|
}
|
|
|
// 获取更新之前的存在冲突的工序作业
|
|
|
- List<String> beforeUpdatingConflictId = this.baseMapper.getConflictId(changeStartTimeVo.getQeuId(), changeStartTimeVo.getId(),
|
|
|
+ List<ApsProcessOperationProcessEquDo> beforeUpdatingConflictId = this.baseMapper.getConflictId(changeStartTimeVo.getQeuId(), changeStartTimeVo.getId(),
|
|
|
changeStartTimeVo.getPlanStartTime(), changeStartTimeVo.getPlanEndTime());
|
|
|
|
|
|
|
|
|
// 找到更新时间之后存在冲突的工序作业
|
|
|
- List<String> afterTheUpdateConflictId = this.baseMapper.getConflictId(changeStartTimeVo.getQeuId(), changeStartTimeVo.getId(),
|
|
|
+ List<ApsProcessOperationProcessEquDo> afterTheUpdateConflictId = this.baseMapper.getConflictId(changeStartTimeVo.getQeuId(), changeStartTimeVo.getId(),
|
|
|
changeStartTimeVo.getPlanStartTime(), changeStartTimeVo.getPlanEndTime());
|
|
|
if (!beforeUpdatingConflictId.isEmpty()) {
|
|
|
- this.update(new LambdaUpdateWrapper<ApsProcessOperationProcessEquDo>()
|
|
|
- .in(ApsProcessOperationProcessEquDo::getId, beforeUpdatingConflictId)
|
|
|
- .set(ApsProcessOperationProcessEquDo::getHasconflict, LOCKMARK_N)
|
|
|
- .set(ApsProcessOperationProcessEquDo::getConflictdes, ""));
|
|
|
+ beforeUpdatingConflictId.forEach(info->{
|
|
|
+ String conflictdes = info.getConflictdes();
|
|
|
+ if(StringUtils.isNotBlank(conflictdes)){
|
|
|
+ List<String> conflictdeList = new ArrayList<>(Arrays.asList(conflictdes.split(",")));
|
|
|
+ // 删除加工时间冲突描述
|
|
|
+ conflictdeList.remove(CONFLICTING_PROCESSING_TIMES);
|
|
|
+ if(conflictdeList.isEmpty()){
|
|
|
+ info.setHasconflict(LOCKMARK_N);
|
|
|
+ }
|
|
|
+ info.setConflictdes(CollUtil.join(conflictdeList, ","));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.updateBatchById(beforeUpdatingConflictId);
|
|
|
}
|
|
|
if (!afterTheUpdateConflictId.isEmpty()) {
|
|
|
processEquDo.setHasconflict(LOCKMARK_Y);
|
|
|
processEquDo.setConflictdes(CONFLICTING_PROCESSING_TIMES);
|
|
|
- this.update(new LambdaUpdateWrapper<ApsProcessOperationProcessEquDo>()
|
|
|
- .in(ApsProcessOperationProcessEquDo::getId, afterTheUpdateConflictId)
|
|
|
- .set(ApsProcessOperationProcessEquDo::getHasconflict, LOCKMARK_Y)
|
|
|
- .set(ApsProcessOperationProcessEquDo::getConflictdes, CONFLICTING_PROCESSING_TIMES));
|
|
|
+ afterTheUpdateConflictId.forEach(info->{
|
|
|
+ info.setHasconflict(LOCKMARK_Y);
|
|
|
+ String conflictdes = info.getConflictdes();
|
|
|
+ if(StringUtils.isNotBlank(conflictdes)){
|
|
|
+ List<String> conflictdeList = new ArrayList<>(Arrays.asList(conflictdes.split(",")));
|
|
|
+ if(!conflictdeList.contains(CONFLICTING_PROCESSING_TIMES)){
|
|
|
+ conflictdeList.add(CONFLICTING_PROCESSING_TIMES);
|
|
|
+ }
|
|
|
+ info.setConflictdes(CollUtil.join(conflictdeList, ","));
|
|
|
+ }else {
|
|
|
+ info.setConflictdes(CONFLICTING_PROCESSING_TIMES);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.updateBatchById(afterTheUpdateConflictId);
|
|
|
}
|
|
|
processEquDo.setPlanstartdate(changeStartTimeVo.getPlanStartTime());
|
|
|
processEquDo.setPlanenddate(changeStartTimeVo.getPlanEndTime());
|