快速排查新增字段与前端保存逻辑

This commit is contained in:
2026-03-23 15:33:12 +08:00
parent 3f503eab0c
commit 31f85e7cd6
9 changed files with 763 additions and 335 deletions

View File

@@ -39,10 +39,36 @@ public class ApsQuickSheetServiceImpl implements ApsQuickSheetService {
Long lineId = row.getLineId();
String lineName = row.getLineName();
String planCode = row.getPlanCode();
String planType = row.getPlanType();
String scheduler = row.getScheduler();
String remark = row.getRemark();
String bizSeqNo = row.getBizSeqNo();
String orderCode = row.getOrderCode();
String contractCode = row.getContractCode();
String customerName = row.getCustomerName();
String salesman = row.getSalesman();
String productName = row.getProductName();
String productMaterial = row.getProductMaterial();
BigDecimal coatingG = parseQty(row.getCoatingG());
BigDecimal productWidth = parseQty(row.getProductWidth());
BigDecimal rollingThick = parseQty(row.getRollingThick());
BigDecimal markCoatThick = parseQty(row.getMarkCoatThick());
String tonSteelLengthRange = row.getTonSteelLengthRange();
BigDecimal planQty = parseQty(row.getPlanQty());
BigDecimal planWeight = parseQty(row.getPlanWeight());
String surfaceTreatment = row.getSurfaceTreatment();
String widthReq = row.getWidthReq();
String usageReq = row.getUsageReq();
String postProcess = row.getPostProcess();
String nextProcess = row.getNextProcess();
String sampleReq = row.getSampleReq();
String rawManufacturer = row.getRawManufacturer();
String rawMaterial = row.getRawMaterial();
BigDecimal rawThick = parseQty(row.getRawThick());
BigDecimal rawWidth = parseQty(row.getRawWidth());
String rawMaterialId = row.getRawMaterialId();
String rawCoilNos = row.getRawCoilNos();
String rawLocation = row.getRawLocation();
@@ -50,15 +76,23 @@ public class ApsQuickSheetServiceImpl implements ApsQuickSheetService {
String rawEdgeReq = row.getRawEdgeReq();
String rawCoatingType = row.getRawCoatingType();
BigDecimal rawNetWeight = parseQty(row.getRawNetWeight());
BigDecimal planQty = parseQty(row.getPlanQty());
LocalDateTime startTime = parseTime(row.getStartTime());
LocalDateTime endTime = parseTime(row.getEndTime());
boolean hasAny = lineId != null || isNotBlank(lineName) || isNotBlank(planCode) || isNotBlank(orderCode)
|| isNotBlank(customerName) || isNotBlank(salesman) || isNotBlank(productName)
boolean hasAny = lineId != null || isNotBlank(lineName) || isNotBlank(planCode) || isNotBlank(planType)
|| isNotBlank(scheduler) || isNotBlank(remark)
|| isNotBlank(bizSeqNo) || isNotBlank(orderCode) || isNotBlank(contractCode)
|| isNotBlank(customerName) || isNotBlank(salesman)
|| isNotBlank(productName) || isNotBlank(productMaterial)
|| coatingG != null || productWidth != null || rollingThick != null || markCoatThick != null
|| isNotBlank(tonSteelLengthRange) || planQty != null || planWeight != null
|| isNotBlank(surfaceTreatment) || isNotBlank(widthReq) || isNotBlank(usageReq)
|| isNotBlank(postProcess) || isNotBlank(nextProcess) || isNotBlank(sampleReq)
|| isNotBlank(rawManufacturer) || isNotBlank(rawMaterial)
|| rawThick != null || rawWidth != null
|| isNotBlank(rawMaterialId) || isNotBlank(rawCoilNos) || isNotBlank(rawLocation)
|| isNotBlank(rawPackaging) || isNotBlank(rawEdgeReq) || isNotBlank(rawCoatingType)
|| rawNetWeight != null || planQty != null || startTime != null || endTime != null;
|| rawNetWeight != null || startTime != null || endTime != null;
if (!hasAny) {
continue;
}
@@ -66,11 +100,23 @@ public class ApsQuickSheetServiceImpl implements ApsQuickSheetService {
if (!isNotBlank(planCode)) {
planCode = buildPlanCode();
}
quickSheetMapper.insertRow(lineId, lineName, LocalDate.now(), planCode, orderCode, customerName, salesman, productName,
rawMaterialId, rawCoilNos, rawLocation, rawPackaging, rawEdgeReq, rawCoatingType, rawNetWeight, planQty, startTime, endTime, operator, operator);
quickSheetMapper.insertRow(lineId, lineName, LocalDate.now(), planCode, planType, scheduler, remark,
bizSeqNo, orderCode, contractCode, customerName, salesman,
productName, productMaterial, coatingG, productWidth, rollingThick, markCoatThick,
tonSteelLengthRange, planQty, planWeight, surfaceTreatment, widthReq, usageReq,
postProcess, nextProcess, sampleReq,
rawManufacturer, rawMaterial, rawThick, rawWidth, rawMaterialId, rawCoilNos,
rawLocation, rawPackaging, rawEdgeReq, rawCoatingType, rawNetWeight,
startTime, endTime, operator, operator);
} else {
quickSheetMapper.updateRow(id, lineId, lineName, planCode, orderCode, customerName, salesman, productName,
rawMaterialId, rawCoilNos, rawLocation, rawPackaging, rawEdgeReq, rawCoatingType, rawNetWeight, planQty, startTime, endTime, operator);
quickSheetMapper.updateRow(id, lineId, lineName, planCode, planType, scheduler, remark,
bizSeqNo, orderCode, contractCode, customerName, salesman,
productName, productMaterial, coatingG, productWidth, rollingThick, markCoatThick,
tonSteelLengthRange, planQty, planWeight, surfaceTreatment, widthReq, usageReq,
postProcess, nextProcess, sampleReq,
rawManufacturer, rawMaterial, rawThick, rawWidth, rawMaterialId, rawCoilNos,
rawLocation, rawPackaging, rawEdgeReq, rawCoatingType, rawNetWeight,
startTime, endTime, operator);
}
}
}
@@ -105,7 +151,7 @@ public class ApsQuickSheetServiceImpl implements ApsQuickSheetService {
title.setHeightInPoints(36f);
org.apache.poi.ss.usermodel.Cell t0 = title.createCell(0);
t0.setCellValue("快速排产表Excel录入");
sheet.addMergedRegion(new org.apache.poi.ss.util.CellRangeAddress(0, 0, 0, 14));
sheet.addMergedRegion(new org.apache.poi.ss.util.CellRangeAddress(0, 0, 0, 39));
org.apache.poi.ss.usermodel.CellStyle titleStyle = wb.createCellStyle();
titleStyle.setAlignment(org.apache.poi.ss.usermodel.HorizontalAlignment.CENTER);
@@ -117,9 +163,12 @@ public class ApsQuickSheetServiceImpl implements ApsQuickSheetService {
t0.setCellStyle(titleStyle);
String[] headers = new String[]{
"产线", "计划号", "单号", "客户", "业务员", "产品",
"原料钢卷", "原料卷", "钢卷位置", "包装要求", "切边要求", "镀层种类",
"原料净重", "计划数量", "开始时间", "结束时间"
"产线", "排产日期", "排产单号", "排产类型", "排产人", "修改人", "备注",
"内容序", "销售内容", "订单合同号", "客户", "业务员",
"成品名称", "材质", "镀层g", "成品宽度", "轧制厚度", "标丝厚度", "吨钢长度区间m",
"数量", "重量", "表面处理", "切边要求", "宽度要求", "用途", "后处理", "下工序", "取样",
"厂家", "原料信息", "原料厚度mm", "宽度mm", "原料钢卷", "原料卷号", "钢卷位置", "包装要求", "镀层种类", "原料净重",
"开始时间", "结束时间"
};
org.apache.poi.ss.usermodel.Row head = sheet.createRow(r++);
for (int i = 0; i < headers.length; i++) {
@@ -131,19 +180,46 @@ public class ApsQuickSheetServiceImpl implements ApsQuickSheetService {
org.apache.poi.ss.usermodel.Row rr = sheet.createRow(r++);
int cc = 0;
rr.createCell(cc++).setCellValue(nvl(row.getLineName(), row.getLineId()));
rr.createCell(cc++).setCellValue(row.getPlanDate() == null ? "" : row.getPlanDate().toString());
rr.createCell(cc++).setCellValue(nvl(row.getPlanCode(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getPlanType(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getScheduler(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRemark(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getBizSeqNo(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getOrderCode(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getContractCode(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getCustomerName(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getSalesman(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getProductName(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getProductMaterial(), ""));
rr.createCell(cc++).setCellValue(row.getCoatingG() == null ? "" : row.getCoatingG().toPlainString());
rr.createCell(cc++).setCellValue(row.getProductWidth() == null ? "" : row.getProductWidth().toPlainString());
rr.createCell(cc++).setCellValue(row.getRollingThick() == null ? "" : row.getRollingThick().toPlainString());
rr.createCell(cc++).setCellValue(row.getMarkCoatThick() == null ? "" : row.getMarkCoatThick().toPlainString());
rr.createCell(cc++).setCellValue(nvl(row.getTonSteelLengthRange(), ""));
rr.createCell(cc++).setCellValue(row.getPlanQty() == null ? "" : row.getPlanQty().toPlainString());
rr.createCell(cc++).setCellValue(row.getPlanWeight() == null ? "" : row.getPlanWeight().toPlainString());
rr.createCell(cc++).setCellValue(nvl(row.getSurfaceTreatment(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getWidthReq(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawEdgeReq(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getUsageReq(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getPostProcess(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getNextProcess(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getSampleReq(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawManufacturer(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawMaterial(), ""));
rr.createCell(cc++).setCellValue(row.getRawThick() == null ? "" : row.getRawThick().toPlainString());
rr.createCell(cc++).setCellValue(row.getRawWidth() == null ? "" : row.getRawWidth().toPlainString());
rr.createCell(cc++).setCellValue(nvl(row.getRawMaterialId(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawCoilNos(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawLocation(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawPackaging(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawEdgeReq(), ""));
rr.createCell(cc++).setCellValue(nvl(row.getRawCoatingType(), ""));
rr.createCell(cc++).setCellValue(row.getRawNetWeight() == null ? "" : row.getRawNetWeight().toPlainString());
rr.createCell(cc++).setCellValue(row.getPlanQty() == null ? "" : row.getPlanQty().toPlainString());
rr.createCell(cc++).setCellValue(row.getStartTime() == null ? "" : row.getStartTime().toString());
rr.createCell(cc++).setCellValue(row.getEndTime() == null ? "" : row.getEndTime().toString());
}