| @@ -17,6 +17,7 @@ data class M18ProductPro ( | |||||
| val id: Long, | val id: Long, | ||||
| val code: String, | val code: String, | ||||
| val desc: String, | val desc: String, | ||||
| val udfProducttype: String, | |||||
| val unitId: Long, | val unitId: Long, | ||||
| val seriesId: Long, | val seriesId: Long, | ||||
| val lastModifyDate: Long, | val lastModifyDate: Long, | ||||
| @@ -149,7 +149,14 @@ open class M18MasterDataService( | |||||
| name = pro.desc, | name = pro.desc, | ||||
| // type = if (pro.seriesId == m18Config.SERIESID_PF) ProductType.MATERIAL | // type = if (pro.seriesId == m18Config.SERIESID_PF) ProductType.MATERIAL | ||||
| // else ItemType.PRODUCT, | // else ItemType.PRODUCT, | ||||
| type = ItemType.MATERIAL, | |||||
| type = when (pro.udfProducttype) { | |||||
| M18ItemType.CONSUMABLES.type -> ItemType.CONSUMABLES | |||||
| M18ItemType.NONCONSUMABLES.type -> ItemType.NONCONSUMABLES | |||||
| M18ItemType.FG.type -> ItemType.FG | |||||
| M18ItemType.SFG.type -> ItemType.SFG | |||||
| M18ItemType.ITEM.type -> ItemType.ITEM | |||||
| else -> ItemType.MATERIAL | |||||
| }, | |||||
| id = existingItem?.id, | id = existingItem?.id, | ||||
| description = pro.desc, | description = pro.desc, | ||||
| remarks = null, | remarks = null, | ||||
| @@ -236,7 +243,14 @@ open class M18MasterDataService( | |||||
| name = pro.desc, | name = pro.desc, | ||||
| // type = if (pro.seriesId == m18Config.SERIESID_PF) ProductType.MATERIAL | // type = if (pro.seriesId == m18Config.SERIESID_PF) ProductType.MATERIAL | ||||
| // else ItemType.PRODUCT, | // else ItemType.PRODUCT, | ||||
| type = ItemType.MATERIAL, | |||||
| type = when (pro.udfProducttype) { | |||||
| M18ItemType.CONSUMABLES.type -> ItemType.CONSUMABLES | |||||
| M18ItemType.NONCONSUMABLES.type -> ItemType.NONCONSUMABLES | |||||
| M18ItemType.FG.type -> ItemType.FG | |||||
| M18ItemType.SFG.type -> ItemType.SFG | |||||
| M18ItemType.ITEM.type -> ItemType.ITEM | |||||
| else -> ItemType.MATERIAL | |||||
| }, | |||||
| id = existingItem?.id, | id = existingItem?.id, | ||||
| description = pro.desc, | description = pro.desc, | ||||
| remarks = null, | remarks = null, | ||||
| @@ -1,7 +1,6 @@ | |||||
| package com.ffii.fpsms.modules.master.entity | package com.ffii.fpsms.modules.master.entity | ||||
| import com.ffii.core.support.AbstractRepository | import com.ffii.core.support.AbstractRepository | ||||
| import com.ffii.fpsms.modules.master.web.models.ItemType | |||||
| import org.springframework.data.jpa.repository.Query | import org.springframework.data.jpa.repository.Query | ||||
| import org.springframework.stereotype.Repository | import org.springframework.stereotype.Repository | ||||
| import java.io.Serializable | import java.io.Serializable | ||||
| @@ -1,7 +1,6 @@ | |||||
| package com.ffii.fpsms.modules.master.entity | package com.ffii.fpsms.modules.master.entity | ||||
| import com.ffii.core.entity.BaseEntity | import com.ffii.core.entity.BaseEntity | ||||
| import com.ffii.fpsms.modules.master.web.models.ItemType | |||||
| import jakarta.persistence.* | import jakarta.persistence.* | ||||
| import jakarta.validation.constraints.NotNull | import jakarta.validation.constraints.NotNull | ||||
| import java.time.LocalDateTime | import java.time.LocalDateTime | ||||
| @@ -4,7 +4,6 @@ import com.ffii.core.utils.CriteriaArgsBuilder | |||||
| import com.ffii.fpsms.modules.master.entity.projections.QcCheckInfo | import com.ffii.fpsms.modules.master.entity.projections.QcCheckInfo | ||||
| import com.ffii.fpsms.modules.master.service.QcCheckService | import com.ffii.fpsms.modules.master.service.QcCheckService | ||||
| import com.ffii.fpsms.modules.master.web.models.MessageResponse | import com.ffii.fpsms.modules.master.web.models.MessageResponse | ||||
| import com.ffii.fpsms.modules.master.web.models.NewItemRequest | |||||
| import com.ffii.fpsms.modules.master.web.models.NewQcCheckRequest | import com.ffii.fpsms.modules.master.web.models.NewQcCheckRequest | ||||
| import jakarta.servlet.http.HttpServletRequest | import jakarta.servlet.http.HttpServletRequest | ||||
| import jakarta.validation.Valid | import jakarta.validation.Valid | ||||
| @@ -4,12 +4,30 @@ import jakarta.validation.constraints.NotBlank | |||||
| import jakarta.validation.constraints.NotNull | import jakarta.validation.constraints.NotNull | ||||
| import java.time.LocalDateTime | import java.time.LocalDateTime | ||||
| //enum class ItemType(val type: String) { | |||||
| // MATERIAL("mat"), | |||||
| // BY_PRODUCT("byp"), | |||||
| // PRODUCT("product"), | |||||
| // CONSUMABLE("consumables"), | |||||
| //} | |||||
| enum class ItemType(val type: String) { | enum class ItemType(val type: String) { | ||||
| MATERIAL("mat"), | |||||
| BY_PRODUCT("byp"), | |||||
| PRODUCT("product"), | |||||
| CONSUMABLE("consumables"), | |||||
| MATERIAL("mat"), // default | |||||
| CONSUMABLES("consumables"), | |||||
| NONCONSUMABLES("non-consumables"), | |||||
| FG("fg"), | |||||
| SFG("sfg"), | |||||
| ITEM("item"), | |||||
| } | |||||
| enum class M18ItemType(val type: String) { | |||||
| CONSUMABLES("Consumable Material"), | |||||
| NONCONSUMABLES("Non-consumable Material"), | |||||
| FG("Product"), | |||||
| SFG("WIP"), | |||||
| ITEM("Item"), | |||||
| } | } | ||||
| data class NewItemRequest( | data class NewItemRequest( | ||||
| @field:NotBlank(message = "material code cannot be empty") | @field:NotBlank(message = "material code cannot be empty") | ||||
| val code: String, | val code: String, | ||||
| @@ -1,7 +1,6 @@ | |||||
| package com.ffii.fpsms.modules.qc.web | package com.ffii.fpsms.modules.qc.web | ||||
| import com.ffii.fpsms.modules.master.web.models.MessageResponse | import com.ffii.fpsms.modules.master.web.models.MessageResponse | ||||
| import com.ffii.fpsms.modules.master.web.models.NewItemRequest | |||||
| import com.ffii.fpsms.modules.qc.entity.projection.QcResultInfo | import com.ffii.fpsms.modules.qc.entity.projection.QcResultInfo | ||||
| import com.ffii.fpsms.modules.qc.service.QcResultService | import com.ffii.fpsms.modules.qc.service.QcResultService | ||||
| import com.ffii.fpsms.modules.qc.web.model.SaveQcResultRequest | import com.ffii.fpsms.modules.qc.web.model.SaveQcResultRequest | ||||