日历

parent 97f10b74
......@@ -3,6 +3,8 @@ package com.aps.service;
import com.aps.entity.ProdEquipSpecialCal;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Collection;
/**
* <p>
* 设备特殊日历配置表:记录特定工位/设备在指定时间段的特殊日历规则(如节假日、维护期等) 服务类
......@@ -18,4 +20,19 @@ public interface ProdEquipSpecialCalService extends IService<ProdEquipSpecialCal
*/
void copyFromEquipCapacityDef(String sceneId);
/**
* Copy calculated equipment shift capacity rows into the scene calendar table.
*/
void copyFromEquipShiftCapacity(String sceneId);
/**
* Copy calculated equipment shift capacity rows for the scene's plan resources.
*/
void copyFromEquipShiftCapacity(String sceneId, Collection<Long> planResourceIds);
/**
* Prefer calculated equipment shift capacity rows, then fall back to legacy capacity definitions.
*/
void copyCalendarWithFallback(String sceneId, Collection<Long> planResourceIds);
}
......@@ -121,9 +121,6 @@ public class LanuchServiceImpl implements LanuchService {
}
sceneId = sceneConfig.getSceneId();
prodEquipSpecialCalService.copyFromEquipCapacityDef(sceneId);
List<MesSchedule> mesSchedules = mesScheduleService.lambdaQuery()
.eq(MesSchedule::getIsDeleted, 0)
.eq(MesSchedule::getScheduleUserId, username)
......@@ -844,6 +841,11 @@ public class LanuchServiceImpl implements LanuchService {
}
if (!CollectionUtils.isEmpty(allProdEquipments)) {
prodEquipmentService.saveBatch(allProdEquipments, 500);
Set<Long> planResourceIds = allProdEquipments.stream()
.map(ProdEquipment::getEquipId)
.filter(Objects::nonNull)
.collect(Collectors.toSet());
prodEquipSpecialCalService.copyCalendarWithFallback(sceneId, planResourceIds);
}
log.info("完成{}个工单的工序转换",order.size());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment