Parcourir la source

bugFix 解决冲突不正确的问题

xiahan il y a 10 mois
Parent
commit
5078172091

+ 8 - 9
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ApsProcessOperationProcessEquServiceImpl.java

@@ -1078,11 +1078,16 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
 //                        LOCKMARK_N : LOCKMARK_Y);
 //            }
             if (PROCESS_WAY_MERGE.equals(processway)) {
-                if (info.getPlanstartdate().equals(newPlanStartDate)) {
+                if (!info.getPlanstartdate().equals(newPlanStartDate)) {
                     info.setConflictdes(removeConflictsDesc(info.getConflictdes(), removeConflictsDesc));
                     info.setHasconflict(StringUtils.isBlank(info.getConflictdes()) &&
                             StringUtils.isBlank(info.getSoftconflictdes()) ?
                             LOCKMARK_N : LOCKMARK_Y);
+                }else{
+                    info.setConflictdes(addNewConflictsDesc(info.getConflictdes(), removeConflictsDesc));
+                    info.setHasconflict(StringUtils.isBlank(info.getConflictdes()) &&
+                            StringUtils.isBlank(info.getSoftconflictdes()) ?
+                            LOCKMARK_N : LOCKMARK_Y);
                 }
             } else {
                 if (newPlanStartDate.compareTo(info.getPlanenddate()) > 0 ||
@@ -1183,16 +1188,10 @@ public class ApsProcessOperationProcessEquServiceImpl extends ServiceImpl<ApsPro
                                                     String oldEquId, String currentProcessWay) {
         // 受影响的工序作业Id
         List<String> affectedIdList = new ArrayList<>();
-
-        List<ApsProcessOperationProcessEquDo> beforeUpdatingConflictId = null;
-
-
         // 获取更新之前的存在冲突的工序作业
-        beforeUpdatingConflictId = this.baseMapper.getTimeOverlapByEquId(oldEquId,
+        List<ApsProcessOperationProcessEquDo> beforeUpdatingConflictId = this.baseMapper.getTimeOverlapByEquId(oldEquId,
                 apsProcessOperationProcessEquDo.getId(), oldPlanstartdate, oldPlanenddate, currentProcessWay);
-
-
-        if (beforeUpdatingConflictId != null && !beforeUpdatingConflictId.isEmpty()) {
+        if (!beforeUpdatingConflictId.isEmpty()) {
             affectedIdList.addAll(beforeUpdatingConflictId.stream().map(ApsProcessOperationProcessEquDo::getId).collect(Collectors.toList()));
             updateProcessEquBeforeAddConflictsDesc(beforeUpdatingConflictId, EQ_TIME_CROSS, currentProcessWay,
                     apsProcessOperationProcessEquDo.getPlanstartdate(),

+ 1 - 1
cx-aps/cx-aps-common/src/main/java/com/rongwei/bscommon/sys/service/impl/ReportCheckServiceImpl.java

@@ -288,7 +288,7 @@ public class ReportCheckServiceImpl implements ReportCheckService {
             log.error("报工检验前校验失败,当前报工记录已被他人:{}检验", locks.get(id));
             return R.error("该作业已被其他人检验");
         }
-        locks.computeIfAbsent(id, k -> currentUser.getId());
+        locks.put(id, currentUser.getId());
         // 获取报工记录
         ApsReportRecordsDo reportRecordsDo = apsReportRecordsService.getById(id);
         if (reportRecordsDo == null) {

+ 1 - 0
cx-aps/cx-aps-common/src/main/resources/mybatis/ApsProcessOperationProcessEquDao.xml

@@ -477,6 +477,7 @@
         left join aps_process_operation app on apope.PROCESSID = app.ID and app.DELETED='0'
         <where>
             apope.ID != #{id}
+            AND apope.DELETED='0'
             AND  apope.PROCESSDEVICEID =#{equId}
             and ( #{oldStartDate} BETWEEN apope.PLANSTARTDATE AND  apope.PLANENDDATE
             OR  #{oldEndDate} BETWEEN apope.PLANSTARTDATE AND  apope.PLANENDDATE )