|
@@ -708,7 +708,9 @@ public class BilletOriginalProductRecordController extends JeecgController<Bille
|
|
applyColdConfirmInfo(bopr, sysUser);
|
|
applyColdConfirmInfo(bopr, sysUser);
|
|
}else {
|
|
}else {
|
|
// 拆分指定数量的凉坯单
|
|
// 拆分指定数量的凉坯单
|
|
- String appointColdBilletJsonArray = handleAppointColdBillet(bopr, appointColdBilletCount, targetSize, sysUser.getRealname());
|
|
|
|
|
|
+ int startPosition = billetOriginalProductRecordVo.getStartPosition();
|
|
|
|
+ int endPosition = billetOriginalProductRecordVo.getEndPosition();
|
|
|
|
+ String appointColdBilletJsonArray = handleAppointColdBillet(bopr, appointColdBilletCount, targetSize, sysUser.getRealname(), startPosition, endPosition);
|
|
// 更新原堆垛信息,减去已拆分的数量和重量
|
|
// 更新原堆垛信息,减去已拆分的数量和重量
|
|
if (stackArray != null && !stackArray.isEmpty()) {
|
|
if (stackArray != null && !stackArray.isEmpty()) {
|
|
try {
|
|
try {
|
|
@@ -787,7 +789,7 @@ public class BilletOriginalProductRecordController extends JeecgController<Bille
|
|
* @param
|
|
* @param
|
|
* @return
|
|
* @return
|
|
*/
|
|
*/
|
|
- private String handleAppointColdBillet(BilletOriginalProductRecord bopr, int appointColdBilletCount, int targetSize, String coldConfirmBy) {
|
|
|
|
|
|
+ private String handleAppointColdBillet(BilletOriginalProductRecord bopr, int appointColdBilletCount, int targetSize, String coldConfirmBy, int startPosition, int endPosition) {
|
|
|
|
|
|
BigDecimal sizeDecimal = new BigDecimal(targetSize);
|
|
BigDecimal sizeDecimal = new BigDecimal(targetSize);
|
|
BigDecimal weight = calculateWeight(sizeDecimal, appointColdBilletCount);
|
|
BigDecimal weight = calculateWeight(sizeDecimal, appointColdBilletCount);
|
|
@@ -826,15 +828,20 @@ public class BilletOriginalProductRecordController extends JeecgController<Bille
|
|
List<Map<String, Object>> rollSendDetailsList = new ArrayList<>();
|
|
List<Map<String, Object>> rollSendDetailsList = new ArrayList<>();
|
|
rollSendDetailsList.add(rollSendDetail);
|
|
rollSendDetailsList.add(rollSendDetail);
|
|
|
|
|
|
- // 3. 构建 sizeDetails 列表
|
|
|
|
- Map<String, Integer> coldLengthCumulativeCountMap = new HashMap<>(); // 冷坯起始位置
|
|
|
|
- String lengthKey = String.valueOf(targetSize); // 统一使用字符串键
|
|
|
|
|
|
+ // 根据传入的 startPosition 和拆单数量计算 startAmount 和 endAmount
|
|
|
|
+ int startAmount = startPosition;
|
|
|
|
+ int endAmount = startPosition + appointColdBilletCount - 1; // 因为包含起始位置,所以减1
|
|
|
|
+ // 计算原来凉坯单 剩余部分的起止位置
|
|
|
|
+ int remainingStart = endAmount + 1;
|
|
|
|
+ int remainingEnd = endPosition;
|
|
|
|
+ // 对冷坯单拆分后,原始冷坯单的起始位置、终止位置 进行记录
|
|
|
|
+ UpdateWrapper<BilletOriginalProductRecord> updateWrapper = new UpdateWrapper<>();
|
|
|
|
+ updateWrapper.eq("id", bopr.getId()) // 根据ID更新
|
|
|
|
+ .set("start_position", remainingStart) // 指定要更新的字段
|
|
|
|
+ .set("end_position", remainingEnd)
|
|
|
|
+ .set("update_time", new Date());
|
|
|
|
+ billetOriginalProductRecordService.update(updateWrapper);
|
|
|
|
|
|
- // 计算起始根数与终止根数 - 使用一致的字符串键
|
|
|
|
- int lastEndAmount = coldLengthCumulativeCountMap.getOrDefault(lengthKey, 0);
|
|
|
|
- int startAmount = lastEndAmount + 1;
|
|
|
|
- int endAmount = lastEndAmount + appointColdBilletCount;
|
|
|
|
- coldLengthCumulativeCountMap.put(lengthKey, endAmount); // 更新累计值
|
|
|
|
|
|
|
|
Map<String, Object> sizeDetail = new HashMap<>();
|
|
Map<String, Object> sizeDetail = new HashMap<>();
|
|
sizeDetail.put("size", targetSize);
|
|
sizeDetail.put("size", targetSize);
|