use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapValueMeasure.
private void mapValueMeasure(FLUXCharacteristic target, FluxCharacteristicEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
Double valueMeasure = source.getValueMeasure();
String valueMeasureUnitCode = source.getValueMeasureUnitCode();
if (valueMeasure != null || StringUtils.isNotEmpty(valueMeasureUnitCode)) {
MeasureType measureType = new MeasureType();
if (valueMeasure != null) {
measureType.setValue(new BigDecimal(valueMeasure));
}
if (StringUtils.isNotEmpty(valueMeasureUnitCode)) {
measureType.setUnitCode(valueMeasureUnitCode);
}
target.setValueMeasure(measureType);
}
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getGearCharacteristics.
public static GearCharacteristic getGearCharacteristics() {
CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
List<TextType> descriptions = Arrays.asList(getTextType("This is sample text"));
MeasureType valueMeasure = getMeasureType(123, "C62", "57t3yf-ght43yrf-ght56yru-ght7565h");
DateTimeType valueDateTime = getDateTimeType("2016-07-01 11:15:00");
IndicatorType valueIndicator = getIndicatorType(true, "Test value", "Test format");
CodeType valueCode = getCodeType("Code type 1", "4fhry5-thfyr85-67thf-5htr84");
TextType value = getTextType("This is sample Text");
QuantityType valueQuantity = getQuantityType(123);
List<FLUXLocation> specifiedFluxLocations = Arrays.asList(getFluxLocation());
GearCharacteristic gearCharacteristic = new GearCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, value, valueQuantity, specifiedFluxLocations);
return gearCharacteristic;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getMeasureType.
private static MeasureType getMeasureType(int value, String unitCode, String listId) {
MeasureType measureType = new MeasureType();
measureType.setValue(new BigDecimal(value));
measureType.setUnitCode(unitCode);
measureType.setUnitCodeListVersionID(listId);
return measureType;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getDelimitedPeriod.
public static DelimitedPeriod getDelimitedPeriod() {
DateTimeType startDate = getDateTimeType("2011-07-01 11:15:00");
DateTimeType endDate = getDateTimeType("2016-07-01 11:15:00");
MeasureType measureType = getMeasureType(500, "C62", "4rhfy5-fhtydr-tyfr85-ghtyd54");
DelimitedPeriod delimitedPeriod = new DelimitedPeriod(startDate, endDate, measureType);
return delimitedPeriod;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._18.MeasureType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getAapProduct.
public static AAPProduct getAapProduct() {
CodeType speciesCode = getCodeType("Species 1", "qbdcg-3fhr5-rd4kd5-er5tgd5k");
QuantityType quantityType = getQuantityType(123);
MeasureType measureType = getMeasureType(123, "C62", "qbdcg-3fhr5-rd4kd5-er5tgd5k");
CodeType weighingMeansCode = getCodeType("Weighing Means 1", "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k");
CodeType usageCode = getCodeType("Usage Code 1", "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k");
QuantityType packagingUnitQuantity = getQuantityType(1234);
CodeType packagingTypeCode = getCodeType("packaging type 1", "FISH_PACKAGING");
MeasureType packagingUnitAverageWeightMeasure = getMeasureType(123, "C62", "qbdcg-3fhr5-rd4kd5-er5tgd5k");
SalesPrice totalSalesPrice = getSalesPrice(getAmountType(123, "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k", "1"));
SizeDistribution specifiedSizeDistribution = getSizeDistribution(getCodeType("catagory 1", "qbd43cg-3fhr5t65-rd4kd5rt4-er5tgd5k"), getCodeType("class code1", "qbd43cg-3fhr5t65-rd45674-er5tgd5k"));
AAPProduct aapProduct = new AAPProduct(speciesCode, quantityType, measureType, weighingMeansCode, usageCode, packagingUnitQuantity, packagingTypeCode, packagingUnitAverageWeightMeasure, null, totalSalesPrice, specifiedSizeDistribution, null, null);
return aapProduct;
}
Aggregations