|
|
|
@ -554,7 +554,7 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
* <li>R列: 最大直径max -> diameter(直径mm)</li> |
|
|
|
* <li>S列: HU -> handling_unit_flag(HU标志)</li> |
|
|
|
* <li>T列: 密封性 -> is_commonly_used(是否常用)</li> |
|
|
|
* <li>U列: A02型号 -> (暂不处理)</li> |
|
|
|
* <li>U列: A02型号 -> pallet_type(托盘类型)</li> |
|
|
|
* </ul> |
|
|
|
* <p><b>默认值:</b>print_qty=0, inventory_stock_ifs.length=0, inventory_stock_ifs.width=0</p> |
|
|
|
* <p><b>注意:</b></p> |
|
|
|
@ -617,7 +617,7 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
String diameterStr = getValue(data, 17); // R列: 最大直径max |
|
|
|
String handlingUnitFlag = getValue(data, 18); // S列: HU |
|
|
|
String isCommonlyUsed = getValue(data, 19); // T列: 密封性 |
|
|
|
// U列(20): A02型号 - 暂不处理 |
|
|
|
String palletType = getValue(data, 20); // U列: A02型号(托盘类型) |
|
|
|
|
|
|
|
// 检查是否为空行(所有必填字段都为空) |
|
|
|
if (StringUtils.isBlank(rowSite) && StringUtils.isBlank(partNo) |
|
|
|
@ -697,7 +697,9 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
|| StringUtils.isNotBlank(widthStr) |
|
|
|
|| StringUtils.isNotBlank(heightStr) |
|
|
|
|| StringUtils.isNotBlank(diameterStr) |
|
|
|
|| StringUtils.isNotBlank(isCommonlyUsed); |
|
|
|
|| StringUtils.isNotBlank(handlingUnitFlag) |
|
|
|
|| StringUtils.isNotBlank(isCommonlyUsed) |
|
|
|
|| StringUtils.isNotBlank(palletType); |
|
|
|
|
|
|
|
if (hasPartAttributeData) { |
|
|
|
PartAttribute partAttribute = new PartAttribute(); |
|
|
|
@ -708,9 +710,11 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
partAttribute.setWeight(parseBigDecimal(weightStr)); |
|
|
|
partAttribute.setLength(parseBigDecimal(lengthStr)); |
|
|
|
partAttribute.setWidth(parseBigDecimal(widthStr)); |
|
|
|
partAttribute.setHeight(parseBigDecimal(heightStr)); |
|
|
|
partAttribute.setHeight(parseBigDecimal(heightStr)!=null ? parseBigDecimal(heightStr) : BigDecimal.ZERO); // 高度不能为空,默认0 |
|
|
|
partAttribute.setDiameter(parseBigDecimal(diameterStr)); |
|
|
|
partAttribute.setHandlingUnitFlag(normalizeYN(handlingUnitFlag)); |
|
|
|
partAttribute.setIsCommonlyUsed(normalizeYN(isCommonlyUsed)); |
|
|
|
partAttribute.setPalletType(palletType); |
|
|
|
|
|
|
|
rowData.put("part_attribute", partAttribute); |
|
|
|
} |
|
|
|
@ -823,9 +827,7 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
try { |
|
|
|
// 检查是否已存在 |
|
|
|
PartAttribute existing = partAttributeMapper.getPartAttributeByKey( |
|
|
|
partAttribute.getSite(), |
|
|
|
partAttribute.getPartNo() |
|
|
|
); |
|
|
|
partAttribute.getSite(), partAttribute.getPartNo(), partAttribute.getHeight()); |
|
|
|
|
|
|
|
if (existing != null) { |
|
|
|
log.debug("料件属性已存在,跳过: site={}, partNo={}", |
|
|
|
@ -887,7 +889,7 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
|
|
|
|
/** |
|
|
|
* 批量删除IFS库存数据(真实删除) |
|
|
|
* |
|
|
|
* |
|
|
|
* @param items 删除项列表 |
|
|
|
* @return 删除的记录数 |
|
|
|
*/ |
|
|
|
@ -895,9 +897,9 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
@Transactional |
|
|
|
public int batchDeleteInventory(List<Map<String, String>> items) { |
|
|
|
log.info("=== 开始批量删除IFS库存 === 删除项数量: {}", items.size()); |
|
|
|
|
|
|
|
|
|
|
|
int deletedCount = 0; |
|
|
|
|
|
|
|
|
|
|
|
for (Map<String, String> item : items) { |
|
|
|
try { |
|
|
|
String site = item.get("site"); |
|
|
|
@ -906,15 +908,15 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
String batchNo = item.get("batchNo"); |
|
|
|
String locationId = item.get("locationId"); |
|
|
|
String wdr = item.get("wdr"); |
|
|
|
|
|
|
|
log.info("删除记录: site={}, warehouse={}, partNo={}, batchNo={}, location={}, wdr={}", |
|
|
|
|
|
|
|
log.info("删除记录: site={}, warehouse={}, partNo={}, batchNo={}, location={}, wdr={}", |
|
|
|
site, warehouseId, partNo, batchNo, locationId, wdr); |
|
|
|
|
|
|
|
|
|
|
|
// 执行删除 |
|
|
|
String deleteSql = "DELETE FROM inventory_stock_ifs " + |
|
|
|
"WHERE site = ? AND ISNULL(warehouse_id, '') = ISNULL(?, '') AND part_no = ? " + |
|
|
|
"AND batch_no = ? AND location_id = ? AND ISNULL(wdr, '') = ISNULL(?, '')"; |
|
|
|
|
|
|
|
|
|
|
|
int rows = jdbcTemplate.update(deleteSql, |
|
|
|
site, |
|
|
|
warehouseId, |
|
|
|
@ -923,16 +925,16 @@ public class IfsInventoryInitServiceImpl implements IfsInventoryInitService { |
|
|
|
locationId, |
|
|
|
wdr |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
deletedCount += rows; |
|
|
|
log.debug("删除成功: 影响行数={}", rows); |
|
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
log.error("删除记录失败: {}", e.getMessage(), e); |
|
|
|
throw new RuntimeException("删除失败: " + e.getMessage()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
log.info("=== 批量删除完成 === 总删除记录数: {}", deletedCount); |
|
|
|
return deletedCount; |
|
|
|
} |
|
|
|
|