| @@ -37,4 +37,8 @@ open class QcResult: BaseEntity<Long>() { | |||||
| @Column(name = "remarks") | @Column(name = "remarks") | ||||
| open var remarks: String? = null | open var remarks: String? = null | ||||
| @NotNull | |||||
| @Column(name = "qcPassed") | |||||
| open var qcPassed: Boolean = true | |||||
| } | } | ||||
| @@ -4,15 +4,19 @@ import org.springframework.beans.factory.annotation.Value | |||||
| interface QcResultInfo { | interface QcResultInfo { | ||||
| val id: Long | val id: Long | ||||
| @get:Value("#{target.qcItem.id}") | |||||
| val qcItemId: Long | |||||
| @get:Value("#{target.qcItem.name}") | |||||
| val name: String | |||||
| @get:Value("#{target.qcItem.code}") | |||||
| val code: String | |||||
| @get:Value("#{target.qcItem?.id}") | |||||
| val qcItemId: Long? | |||||
| @get:Value("#{target.qcItem?.code}") | |||||
| val code: String? | |||||
| @get:Value("#{target.qcItem?.name}") | |||||
| val name: String? | |||||
| @get:Value("#{target.qcItem?.description}") | |||||
| val description: String? | |||||
| val remarks: String? | |||||
| @get:Value("#{target.stockInLine?.id}") | @get:Value("#{target.stockInLine?.id}") | ||||
| val stockInLineId: Long? | val stockInLineId: Long? | ||||
| @get:Value("#{target.stockOutLine?.id}") | @get:Value("#{target.stockOutLine?.id}") | ||||
| val stockOutLineId: Long? | val stockOutLineId: Long? | ||||
| val failQty: Double | |||||
| val failQty: Double? | |||||
| val qcPassed: Boolean | |||||
| } | } | ||||
| @@ -42,6 +42,7 @@ open class QcResultService( | |||||
| this.failQty = request.failQty | this.failQty = request.failQty | ||||
| this.type = request.type | this.type = request.type | ||||
| this.remarks = request.remarks | this.remarks = request.remarks | ||||
| this.qcPassed = request.qcPassed | |||||
| } | } | ||||
| val savedQcResult = saveAndFlush(qcResult) | val savedQcResult = saveAndFlush(qcResult) | ||||
| return MessageResponse( | return MessageResponse( | ||||
| @@ -7,6 +7,7 @@ data class SaveQcResultRequest( | |||||
| val stockInLineId: Long?, | val stockInLineId: Long?, | ||||
| val stockOutLineId: Long?, | val stockOutLineId: Long?, | ||||
| val failQty: Double, | val failQty: Double, | ||||
| val qcPassed: Boolean, | |||||
| val type: String?, | val type: String?, | ||||
| val remarks: String?, | val remarks: String?, | ||||
| ) | ) | ||||
| @@ -171,6 +171,7 @@ open class StockInLineService( | |||||
| this.item = item | this.item = item | ||||
| this.stockInLine = stockInLine | this.stockInLine = stockInLine | ||||
| this.failQty = it.failQty | this.failQty = it.failQty | ||||
| this.qcPassed = it.qcPassed | |||||
| this.type = "qc" // default as qc for now | this.type = "qc" // default as qc for now | ||||
| this.remarks = it.remarks | this.remarks = it.remarks | ||||
| } | } | ||||
| @@ -0,0 +1,4 @@ | |||||
| -- liquibase formatted sql | |||||
| -- changeset kelvin:update qc result table | |||||
| ALTER TABLE `qc_result` | |||||
| ADD COLUMN `qcPassed` TINYINT(1) NOT NULL DEFAULT 1 AFTER `remarks`; | |||||