|
|
|
|
@ -636,11 +636,11 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
craftLock.lock(); // 加本地锁,同一工艺ID串行执行
|
|
|
|
|
try{ |
|
|
|
|
//查询大于当前时间+半小时的所有人员资源
|
|
|
|
|
List<PersonResourceEntity> personResourceList = personResourceService.list(Wrappers.<PersonResourceEntity>lambdaQuery().ge(PersonResourceEntity::getStartTime,prevProcessEnd.plusMinutes(30)).eq(PersonResourceEntity::getCraftId,craft.getCaId()).orderByAsc(PersonResourceEntity::getStartTime).last("for update")); |
|
|
|
|
List<PersonResourceEntity> personResourceList = personResourceService.list(Wrappers.<PersonResourceEntity>lambdaQuery().ge(PersonResourceEntity::getStartTime,prevProcessEnd.plusMinutes(30)).eq(PersonResourceEntity::getCraftId,craft.getCaId()).eq(PersonResourceEntity::getIsUsed,0).orderByAsc(PersonResourceEntity::getStartTime).last("for update")); |
|
|
|
|
//如果personResourceList不为空,说明是镀后检验或者镀后验收这类跨作业中心的工艺
|
|
|
|
|
if(CollectionUtils.isNotEmpty(personResourceList)){ |
|
|
|
|
//剔除掉personResourceList中isUsed=1之前的数据,isUsed=1说明这些时间被占用了
|
|
|
|
|
int isUsedIndex = -1; |
|
|
|
|
/* int isUsedIndex = -1; |
|
|
|
|
for(int m=0;m<personResourceList.size();m++){ |
|
|
|
|
if("1".equals(personResourceList.get(m).getIsUsed())){ |
|
|
|
|
isUsedIndex = m; |
|
|
|
|
@ -648,7 +648,7 @@ public class WorkOrderServiceImpl extends BaseServiceImpl<WorkOrderMapper, WorkO |
|
|
|
|
} |
|
|
|
|
if(isUsedIndex != -1){ |
|
|
|
|
personResourceList = personResourceList.subList(isUsedIndex + 1, personResourceList.size()); |
|
|
|
|
} |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
//计算加工时间占几个人力片段
|
|
|
|
|
//int period = totalTime.divide(BigDecimal.valueOf(30),0, RoundingMode.CEILING).intValue();
|
|
|
|
|
|