[BO] 일계부 농업생산물 등록, 수정 [FO] 농업생산물 수입/지출부호 Util 로 변경
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package app.module.core.config.application.util;
|
||||
|
||||
import app.module.core.usecase.uicode.list.ports.application.domain.UICodeElement;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@@ -9,6 +10,8 @@ import java.text.DecimalFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
@Slf4j
|
||||
@@ -126,4 +129,35 @@ public class DailyUtil {
|
||||
|
||||
return new DecimalFormat("###,###").format(Double.parseDouble(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* 농업 생산물의 UI Code 데이터의 수입부호, 지출부호 조회
|
||||
*
|
||||
* @param uiCodeList UI Code 목록
|
||||
* @param targetCode 조회 코드
|
||||
* @return 수입부호, 지출부호 Map
|
||||
*/
|
||||
public HashMap<String, String> getMarkByFarming(List<UICodeElement> uiCodeList, String targetCode) {
|
||||
String incomeMark = null;
|
||||
String expenseMark = null;
|
||||
if (!"code.record.farming.self".equals(targetCode)) {
|
||||
String returnValue = null;
|
||||
for (UICodeElement codeSetup : uiCodeList) {
|
||||
if (codeSetup.getId().equalsIgnoreCase(targetCode)) {
|
||||
returnValue = codeSetup.getCodeValue();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (returnValue != null) {
|
||||
incomeMark = returnValue.split(",")[0];
|
||||
expenseMark = returnValue.split(",")[1];
|
||||
}
|
||||
}
|
||||
|
||||
HashMap<String, String> returnValue = new HashMap<>();
|
||||
returnValue.put("incomeMark", incomeMark);
|
||||
returnValue.put("expenseMark", expenseMark);
|
||||
return returnValue;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user