refactor(aps): 排产计划报表导出报错解决
- 将ApsPlanDetailServiceImpl中的IApsPlanSheetService替换为ApsPlanSheetMapper - 直接通过mapper进行数据查询操作,减少服务层依赖 - 修复计划表合并逻辑中的边界条件判断问题 - 确保数据起始行和结束行的有效性验证
This commit is contained in:
@@ -21,8 +21,8 @@ import com.klp.aps.domain.vo.ApsPlanDetailVo;
|
||||
import com.klp.aps.domain.vo.ApsPlanSheetVo;
|
||||
import com.klp.aps.domain.entity.ApsPlanDetail;
|
||||
import com.klp.aps.mapper.ApsPlanDetailMapper;
|
||||
import com.klp.aps.mapper.ApsPlanSheetMapper;
|
||||
import com.klp.aps.service.IApsPlanDetailService;
|
||||
import com.klp.aps.service.IApsPlanSheetService;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
|
||||
public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
|
||||
private final ApsPlanDetailMapper baseMapper;
|
||||
private final IApsPlanSheetService apsPlanSheetService;
|
||||
private final ApsPlanSheetMapper planSheetMapper;
|
||||
private final WmsCoilContractRelMapper coilContractRelMapper;
|
||||
private final IWmsMaterialCoilService materialCoilService;
|
||||
|
||||
@@ -223,7 +223,7 @@ public class ApsPlanDetailServiceImpl implements IApsPlanDetailService {
|
||||
if (planSheetId == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
ApsPlanSheetVo planSheet = apsPlanSheetService.queryById(planSheetId);
|
||||
ApsPlanSheetVo planSheet = planSheetMapper.selectVoById(planSheetId);
|
||||
if (planSheet == null || planSheet.getPlanDate() == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ public class ApsPlanSheetServiceImpl implements IApsPlanSheetService {
|
||||
|
||||
// ================== 【核心:前7列自动合并】 ==================
|
||||
int dataEndRow = r - 1;
|
||||
if (dataStartRow <= dataEndRow) {
|
||||
if (dataStartRow <= dataEndRow && dataEndRow > dataStartRow) {
|
||||
for (int col = 0; col < 7; col++) { // 0~6 共7列
|
||||
CellRangeAddress region = new CellRangeAddress(
|
||||
dataStartRow,
|
||||
|
||||
Reference in New Issue
Block a user