use of org.eevolution.model.MHRConcept in project adempiere by adempiere.
the class HRCreateConcept method updatingConceptProperties.
/**
* Update Concept Properties
* @param concepts
* @return
*/
private int updatingConceptProperties(List<MHRConcept> concepts, int payrollId) {
AtomicInteger count = new AtomicInteger(0);
concepts.stream().filter(concept -> concept != null).forEach(concept -> {
Optional.ofNullable(getSelectionAsString(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_Name)).ifPresent(name -> concept.setName(name));
Optional.ofNullable(getSelectionAsString(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_Description)).ifPresent(description -> concept.setDescription(description));
Optional.ofNullable(getSelectionAsInt(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_HR_Concept_Category_ID)).ifPresent(categoryId -> concept.setHR_Concept_Category_ID(categoryId));
Optional.ofNullable(getSelectionAsInt(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_HR_Concept_Type_ID)).ifPresent(typeId -> concept.setHR_Concept_Type_ID(typeId));
Optional.ofNullable(getSelectionAsInt(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_SeqNo)).ifPresent(seqNo -> concept.setSeqNo(seqNo));
Optional.ofNullable(getSelectionAsString(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_Type)).ifPresent(type -> concept.setType(type));
Optional.ofNullable(getSelectionAsString(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_ColumnType)).ifPresent(columnType -> concept.setColumnType(columnType));
Optional.ofNullable(getSelectionAsString(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_AccountSign)).ifPresent(accountSign -> concept.setAccountSign(accountSign));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsActive)).ifPresent(isActive -> concept.setIsActive(isActive));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsEmployee)).ifPresent(isEmployee -> concept.setIsEmployee(isEmployee));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsManual)).ifPresent(isManual -> concept.setIsManual(isManual));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsPaid)).ifPresent(isPaid -> concept.setIsPaid(isPaid));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsPrepayment)).ifPresent(isPrepayment -> concept.setIsPrepayment(isPrepayment));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsInvoiced)).ifPresent(isInvoiced -> concept.setIsInvoiced(isInvoiced));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsSaveInHistoric)).ifPresent(isSaveInHistoric -> concept.setIsSaveInHistoric(isSaveInHistoric));
Optional.ofNullable(getSelectionAsBoolean(concept.get_ID(), getPrefixAliasForTableSelection() + MHRConcept.COLUMNNAME_IsPrinted)).ifPresent(isPrint -> concept.setIsPrinted(isPrint));
if (concept.is_Changed()) {
count.updateAndGet(no -> no + 1);
concept.saveEx();
addLog("@Updated@ @HR_Concept_ID@ : " + concept.getName());
}
});
return count.get();
}
Aggregations