三级页面修改
This commit is contained in:
@@ -58,7 +58,6 @@ import java.math.BigDecimal;
|
||||
public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
|
||||
private final WmsMaterialCoilMapper baseMapper;
|
||||
private final WmsStockMapper stockMapper;
|
||||
private final IWmsStockService stockService;
|
||||
private final IWmsGenerateRecordService generateRecordService;
|
||||
private final IWmsWarehouseService warehouseService;
|
||||
@@ -384,7 +383,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
newCoil.setCoilId(null); // 清空ID,让数据库自动生成新ID
|
||||
newCoil.setDataType(1); // 设置为当前数据
|
||||
newCoil.setQrcodeRecordId(oldCoil.getQrcodeRecordId()); // 继续使用原二维码
|
||||
|
||||
|
||||
// 继承原记录的关键字段
|
||||
if (newCoil.getEnterCoilNo() == null) {
|
||||
newCoil.setEnterCoilNo(oldCoil.getEnterCoilNo());
|
||||
@@ -392,19 +391,19 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (newCoil.getSupplierCoilNo() == null) {
|
||||
newCoil.setSupplierCoilNo(oldCoil.getSupplierCoilNo());
|
||||
}
|
||||
|
||||
|
||||
validEntityBeforeSave(newCoil);
|
||||
|
||||
|
||||
// 插入新记录
|
||||
boolean flag = baseMapper.insert(newCoil) > 0;
|
||||
|
||||
|
||||
if (flag) {
|
||||
// 3. 更新二维码内容(添加更新步骤并更新current_coil_id)
|
||||
if (oldCoil.getQrcodeRecordId() != null) {
|
||||
updateQrcodeContentForNormalUpdate(oldCoil, bo, newCoil.getCoilId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return flag;
|
||||
}
|
||||
|
||||
@@ -542,7 +541,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
oldQrBo.setStatus(0); // 0=失效
|
||||
generateRecordService.updateByBo(oldQrBo);
|
||||
}
|
||||
|
||||
|
||||
// 2. 将原始钢卷标记为历史数据,并记录所有子卷号
|
||||
// 在母卷的 parent_coil_nos 字段中记录所有子卷号(用逗号分隔)
|
||||
String childCoilNos = String.join(",", allNewCoilNos);
|
||||
@@ -570,7 +569,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
newCoil.setWarehouseId(oldCoil.getWarehouseId());
|
||||
newCoil.setActualWarehouseId(oldCoil.getActualWarehouseId());
|
||||
}
|
||||
|
||||
|
||||
// 在子卷的 parent_coil_nos 字段中记录母卷号
|
||||
newCoil.setParentCoilNos(oldCoil.getCurrentCoilNo());
|
||||
|
||||
@@ -599,7 +598,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
oldQrBo.setStatus(0); // 0=失效
|
||||
generateRecordService.updateByBo(oldQrBo);
|
||||
}
|
||||
|
||||
|
||||
// 标记钢卷为历史数据
|
||||
LambdaUpdateWrapper<WmsMaterialCoil> originalUpdateWrapper = new LambdaUpdateWrapper<>();
|
||||
originalUpdateWrapper.eq(WmsMaterialCoil::getCoilId, originalCoilBo.getCoilId())
|
||||
@@ -877,7 +876,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
newStep.put("old_coil_id", String.valueOf(oldCoil.getCoilId()));
|
||||
newStep.put("new_coil_id", String.valueOf(newCoilId));
|
||||
newStep.put("operator", LoginHelper.getUsername());
|
||||
|
||||
|
||||
// 记录具体的变更字段
|
||||
List<String> changedFields = new ArrayList<>();
|
||||
if (bo.getCurrentCoilNo() != null && !bo.getCurrentCoilNo().equals(oldCoil.getCurrentCoilNo())) {
|
||||
@@ -901,18 +900,18 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (bo.getRemark() != null && !bo.getRemark().equals(oldCoil.getRemark())) {
|
||||
changedFields.add("备注: " + oldCoil.getRemark() + " → " + bo.getRemark());
|
||||
}
|
||||
|
||||
|
||||
newStep.put("changed_fields", String.join("; ", changedFields));
|
||||
newStep.put("update_time", new java.util.Date());
|
||||
|
||||
steps.add(newStep);
|
||||
contentMap.put("steps", steps);
|
||||
|
||||
|
||||
// 更新当前钢卷号
|
||||
if (bo.getCurrentCoilNo() != null) {
|
||||
contentMap.put("current_coil_no", bo.getCurrentCoilNo());
|
||||
}
|
||||
|
||||
|
||||
// 更新 current_coil_id 为新记录的ID
|
||||
if (newCoilId != null) {
|
||||
contentMap.put("current_coil_id", String.valueOf(newCoilId));
|
||||
|
||||
Reference in New Issue
Block a user