完成排产(测试过了)

This commit is contained in:
2026-03-08 16:02:44 +08:00
parent b660ddcc3e
commit 7736ac3311
125 changed files with 10418 additions and 15 deletions

View File

@@ -0,0 +1,64 @@
package com.klp.aps.mapper;
import com.klp.aps.domain.entity.ApsScheduleChangeLogEntity;
import com.klp.aps.domain.entity.ApsScheduleOperationEntity;
import com.klp.aps.domain.row.ApsLineCapabilityRow;
import com.klp.aps.domain.row.ApsLineMetaRow;
import com.klp.aps.domain.row.ApsOrderDetailRow;
import com.klp.aps.domain.row.ApsPlanDetailRow;
import com.klp.aps.domain.row.ApsProductMetaRow;
import com.klp.aps.domain.row.ApsSchedulePlanRow;
import com.klp.aps.domain.row.ApsShiftSlotRow;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.time.LocalDate;
import java.util.List;
public interface ApsAutoScheduleMapper {
ApsSchedulePlanRow selectPlanByIdForUpdate(@Param("planId") Long planId);
List<ApsOrderDetailRow> selectOrderDetailsByOrderId(@Param("orderId") Long orderId);
List<ApsPlanDetailRow> selectPlanDetailsByPlanId(@Param("planId") Long planId);
List<ApsLineCapabilityRow> selectLineCandidatesByProductAndLine(@Param("productId") Long productId,
@Param("lineId") Long lineId);
ApsLineMetaRow selectLineMetaById(@Param("lineId") Long lineId);
ApsProductMetaRow selectProductMetaById(@Param("productId") Long productId);
List<ApsShiftSlotRow> selectAvailableShifts(@Param("lineId") Long lineId,
@Param("startDate") LocalDate startDate,
@Param("endDate") LocalDate endDate);
Long selectPlanDetailId(@Param("planId") Long planId, @Param("taskId") Long taskId);
int deleteUnlockedOperationsByPlanId(@Param("planId") Long planId);
/**
* 返回冲突记录的 end_time若无冲突返回 null
*/
LocalDateTime selectFirstConflictEndTime(@Param("lineId") Long lineId,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime,
@Param("excludeOperationId") Long excludeOperationId);
/**
* 返回命中锁定的 lock_end_time若未命中返回 null
*/
LocalDateTime selectFirstHitLockEndTime(@Param("lineId") Long lineId,
@Param("startTime") LocalDateTime startTime,
@Param("endTime") LocalDateTime endTime,
@Param("planId") Long planId,
@Param("excludeOperationId") Long excludeOperationId);
int insertOperation(ApsScheduleOperationEntity op);
int insertChangeLog(ApsScheduleChangeLogEntity log);
int updatePlanStatus(@Param("planId") Long planId, @Param("status") Integer status, @Param("updateBy") String updateBy);
}

View File

@@ -0,0 +1,27 @@
package com.klp.aps.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.klp.aps.domain.entity.ApsCalendarEntity;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;
/**
* 工厂日历Mapper接口
*/
public interface ApsCalendarMapper extends BaseMapper<ApsCalendarEntity> {
/**
* 查询工厂日历列表
*/
List<ApsCalendarEntity> selectCalendarList(@Param("calendarDate") LocalDate calendarDate,
@Param("calendarType") Integer calendarType,
@Param("factoryCode") String factoryCode);
/**
* 根据日期和工厂编码查询
*/
ApsCalendarEntity selectByDateAndFactory(@Param("calendarDate") LocalDate calendarDate,
@Param("factoryCode") String factoryCode);
}

View File

@@ -0,0 +1,23 @@
package com.klp.aps.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.klp.aps.domain.entity.ApsCalendarShiftEntity;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDate;
import java.util.List;
/**
* 日历班次配置Mapper接口
*/
public interface ApsCalendarShiftMapper extends BaseMapper<ApsCalendarShiftEntity> {
/**
* 根据日期、产线和班次查询
*/
ApsCalendarShiftEntity selectByDateLineAndShift(@Param("calendarDate") LocalDate calendarDate,
@Param("lineId") Long lineId,
@Param("shiftId") Long shiftId);
List<Long> selectDistinctLineIds();
}

View File

@@ -0,0 +1,11 @@
package com.klp.aps.mapper;
import com.klp.aps.domain.dto.ApsGanttQueryReq;
import com.klp.aps.domain.vo.ApsGanttItemVo;
import java.util.List;
public interface ApsGanttMapper {
List<ApsGanttItemVo> selectGanttItems(ApsGanttQueryReq req);
}

View File

@@ -0,0 +1,18 @@
package com.klp.aps.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.klp.aps.domain.entity.ApsLineCapabilityEntity;
import org.apache.ibatis.annotations.Param;
/**
* 产线能力Mapper接口
*/
public interface ApsLineCapabilityMapper extends BaseMapper<ApsLineCapabilityEntity> {
/**
* 根据产线、产品、工序查询
*/
ApsLineCapabilityEntity selectByLineProductAndProcess(@Param("lineId") Long lineId,
@Param("productId") Long productId,
@Param("processId") Long processId);
}

View File

@@ -0,0 +1,14 @@
package com.klp.aps.mapper;
import com.klp.aps.domain.entity.ApsScheduleLockEntity;
import org.apache.ibatis.annotations.Param;
public interface ApsLockMapper {
int insertLock(ApsScheduleLockEntity lock);
int updateLockStatus(@Param("lockId") Long lockId,
@Param("status") Integer status,
@Param("updateBy") String updateBy);
}

View File

@@ -0,0 +1,15 @@
package com.klp.aps.mapper;
import com.klp.aps.domain.entity.ApsScheduleChangeLogEntity;
import com.klp.aps.domain.entity.ApsScheduleOperationEntity;
import org.apache.ibatis.annotations.Param;
public interface ApsOperationMapper {
ApsScheduleOperationEntity selectByIdForUpdate(@Param("operationId") Long operationId);
int updateSlot(ApsScheduleOperationEntity op);
int insertChangeLog(ApsScheduleChangeLogEntity log);
}

View File

@@ -0,0 +1,35 @@
package com.klp.aps.mapper;
import com.klp.aps.domain.dto.ApsWmsOrderCreateReq;
import com.klp.aps.domain.dto.ApsWmsOrderDetailCreateReq;
import com.klp.aps.domain.entity.ApsSchedulePlanDetailEntity;
import com.klp.aps.domain.entity.ApsSchedulePlanEntity;
import com.klp.aps.domain.row.ApsCrmOrderItemRow;
import com.klp.aps.domain.row.ApsCrmOrderRow;
import com.klp.aps.domain.row.ApsOrderDetailRow;
import com.klp.aps.domain.row.ApsWmsOrderRow;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApsPlanMapper {
List<ApsOrderDetailRow> selectOrderDetailsByOrderId(@Param("orderId") Long orderId);
ApsCrmOrderRow selectCrmOrderById(@Param("crmOrderId") String crmOrderId);
List<ApsCrmOrderItemRow> selectCrmOrderItemsByOrderId(@Param("crmOrderId") String crmOrderId);
ApsWmsOrderRow selectWmsOrderByCode(@Param("orderCode") String orderCode);
int insertWmsOrder(ApsWmsOrderCreateReq req);
int insertWmsOrderDetail(ApsWmsOrderDetailCreateReq req);
Long selectAnyProductionLineId();
int insertSchedulePlan(ApsSchedulePlanEntity plan);
int insertSchedulePlanDetail(ApsSchedulePlanDetailEntity detail);
}

View File

@@ -0,0 +1,18 @@
package com.klp.aps.mapper;
import com.klp.aps.domain.dto.ApsScheduleSheetQueryReq;
import com.klp.aps.domain.vo.ApsScheduleSheetRowVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ApsScheduleSheetMapper {
List<ApsScheduleSheetRowVo> selectSheetRows(ApsScheduleSheetQueryReq req);
int deleteOperationCoils(@Param("operationId") Long operationId, @Param("updateBy") String updateBy);
int insertOperationCoil(@Param("operationId") Long operationId, @Param("coilId") Long coilId, @Param("createBy") String createBy);
int updateOperationSupplement(@Param("operationId") Long operationId, @Param("remarkJson") String remarkJson, @Param("updateBy") String updateBy);
}

View File

@@ -0,0 +1,16 @@
package com.klp.aps.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.klp.aps.domain.entity.ApsShiftTemplateEntity;
import org.apache.ibatis.annotations.Param;
/**
* 班次模板Mapper接口
*/
public interface ApsShiftTemplateMapper extends BaseMapper<ApsShiftTemplateEntity> {
/**
* 根据班次编码查询
*/
ApsShiftTemplateEntity selectByShiftCode(@Param("shiftCode") String shiftCode);
}