|
|
|
@@ -1513,13 +1513,13 @@ val sufficientStockQty = bomMaterials |
|
|
|
productProcessLine.startTime = LocalDateTime.now() |
|
|
|
productProcessLineRepository.save(productProcessLine) |
|
|
|
} |
|
|
|
if(allproductProcessLines.all { it.status == "Completed" }) { |
|
|
|
if(allproductProcessLines.all { it.status == "Completed"|| it.status == "Pass" }) { |
|
|
|
updateProductProcessEndTime(productProcessId) |
|
|
|
updateProductProcessStatus(productProcessId, ProductProcessStatus.COMPLETED) |
|
|
|
val productProcess = productProcessRepository.findById(productProcessId).orElse(null) |
|
|
|
val jobOrder = jobOrderRepository.findById(productProcess?.jobOrder?.id?:0L).orElse(null) |
|
|
|
if(jobOrder != null) { |
|
|
|
jobOrder.status = JobOrderStatus.PENDING_QC |
|
|
|
jobOrder.status = JobOrderStatus.STORING |
|
|
|
jobOrderRepository.save(jobOrder) |
|
|
|
|
|
|
|
stockInLineService.create( |
|
|
|
@@ -1827,9 +1827,8 @@ val sufficientStockQty = bomMaterials |
|
|
|
val line = lines[index] |
|
|
|
|
|
|
|
// equipment.description + equipment_detail.name |
|
|
|
val equipmentDescription = line.equipment?.description |
|
|
|
?: try { line.bomProcess?.equipment?.description } catch (_: jakarta.persistence.EntityNotFoundException) { null } |
|
|
|
?: line.equipmentType |
|
|
|
val equipmentName = try { line.bomProcess?.equipment?.name } catch (_: jakarta.persistence.EntityNotFoundException) { null } |
|
|
|
|
|
|
|
|
|
|
|
val equipmentDetailName = line.equipmentDetailId?.let { id -> |
|
|
|
equipmentDetailRepository.findById(id).orElse(null)?.name |
|
|
|
@@ -1837,7 +1836,7 @@ val sufficientStockQty = bomMaterials |
|
|
|
|
|
|
|
ProcessStatusInfo( |
|
|
|
processName = line.name, // ✅ 新增:工序名称 |
|
|
|
equipmentDescription = equipmentDescription, // ✅ 替代 equipmentCode |
|
|
|
equipmentName = equipmentName, // ✅ 替代 equipmentCode |
|
|
|
equipmentDetailName = equipmentDetailName, // ✅ 新增 |
|
|
|
startTime = line.startTime, |
|
|
|
endTime = line.endTime, |
|
|
|
@@ -1849,7 +1848,7 @@ val sufficientStockQty = bomMaterials |
|
|
|
} else { |
|
|
|
ProcessStatusInfo( |
|
|
|
processName = null, |
|
|
|
equipmentDescription = null, |
|
|
|
equipmentName = null, |
|
|
|
equipmentDetailName = null, |
|
|
|
startTime = null, |
|
|
|
endTime = null, |
|
|
|
|