|
|
|
@ -18,26 +18,12 @@ public class CodeConverter {
|
|
|
|
|
List<DataObject> deptList = new ArrayList<DataObject>();
|
|
|
|
|
List<DataObject> vltnList = new ArrayList<DataObject>();
|
|
|
|
|
List<DataObject> userList = new ArrayList<DataObject>();
|
|
|
|
|
List<DataObject> teamList = new ArrayList<DataObject>();
|
|
|
|
|
|
|
|
|
|
public CodeConverter(Map<String, List<CommonCode>> commonCodes){
|
|
|
|
|
this.commonCodes = commonCodes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void putSgg(DataObject dataobject){
|
|
|
|
|
this.sggList.add(dataobject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void putDept(DataObject dataobject){
|
|
|
|
|
this.deptList.add(dataobject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void putVltn(DataObject dataobject){
|
|
|
|
|
this.vltnList.add(dataobject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void putUser(DataObject dataobject){
|
|
|
|
|
this.userList.add(dataobject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 코드값으로 코드를 반환한다.
|
|
|
|
|
* @param codeGroupName 코드그룹명, value 코드값
|
|
|
|
@ -124,65 +110,54 @@ public class CodeConverter {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 위반ID로 위반항목명을 반환한다.
|
|
|
|
|
* @param vltnId 위반ID
|
|
|
|
|
* @return 위반항목명
|
|
|
|
|
*/
|
|
|
|
|
public String vltnIdToValue(String vltnId){
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < vltnList.size(); i++) {
|
|
|
|
|
if(vltnId.equals(vltnList.get(i).string("VLTN_ID"))) {
|
|
|
|
|
result = vltnList.get(i).string("VLTN_NM");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 시군구코드로 시군구명을 반환한다.
|
|
|
|
|
* @param sggCd 시군구코드
|
|
|
|
|
* @return 시군구명
|
|
|
|
|
*/
|
|
|
|
|
public String sggCodeToValue(String sggCd){
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < sggList.size(); i++) {
|
|
|
|
|
if(sggCd.equals(sggList.get(i).string("SGG_CD"))) {
|
|
|
|
|
result = sggList.get(i).string("SGG_NM");
|
|
|
|
|
}
|
|
|
|
|
public void putOtherCode(String type, DataObject dataobject){
|
|
|
|
|
switch(type) {
|
|
|
|
|
case "SGG_CD" :
|
|
|
|
|
this.sggList.add(dataobject);
|
|
|
|
|
break;
|
|
|
|
|
case "DEPT_CD" :
|
|
|
|
|
this.deptList.add(dataobject);
|
|
|
|
|
break;
|
|
|
|
|
case "VLTN_ID" :
|
|
|
|
|
this.vltnList.add(dataobject);
|
|
|
|
|
break;
|
|
|
|
|
case "USER_ID" :
|
|
|
|
|
this.userList.add(dataobject);
|
|
|
|
|
break;
|
|
|
|
|
case "TEAM_ID" :
|
|
|
|
|
this.teamList.add(dataobject);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 부서코드로 부서명을 반환한다.
|
|
|
|
|
* @param deptCd 부서코드
|
|
|
|
|
* @return 부서명
|
|
|
|
|
*/
|
|
|
|
|
public String deptCodeToValue(String deptCd){
|
|
|
|
|
public String uniqOtherCodeToValue(String type, String uniqId) {
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < deptList.size(); i++) {
|
|
|
|
|
if(deptCd.equals(deptList.get(i).string("DEPT_CD"))) {
|
|
|
|
|
result = deptList.get(i).string("DEPT_NM");
|
|
|
|
|
}
|
|
|
|
|
List<DataObject> otherCodeList = null;
|
|
|
|
|
switch(type) {
|
|
|
|
|
case "SGG_CD" :
|
|
|
|
|
otherCodeList = this.sggList;
|
|
|
|
|
break;
|
|
|
|
|
case "DEPT_CD" :
|
|
|
|
|
otherCodeList = this.deptList;
|
|
|
|
|
break;
|
|
|
|
|
case "VLTN_ID" :
|
|
|
|
|
otherCodeList = this.vltnList;
|
|
|
|
|
break;
|
|
|
|
|
case "USER_ID" :
|
|
|
|
|
otherCodeList = this.userList;
|
|
|
|
|
break;
|
|
|
|
|
case "TEAM_ID" :
|
|
|
|
|
otherCodeList = this.teamList;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(otherCodeList == null) {
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 유저ID로 유저이름을 반환한다.
|
|
|
|
|
* @param userId 유저ID
|
|
|
|
|
* @return 유저이름
|
|
|
|
|
*/
|
|
|
|
|
public String userIdToUserName(String userId){
|
|
|
|
|
String result = "";
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < userList.size(); i++) {
|
|
|
|
|
if(userId.equals(userList.get(i).string("USER_ID"))) {
|
|
|
|
|
result = userList.get(i).string("USER_NM");
|
|
|
|
|
for(int i = 0; i < otherCodeList.size(); i++) {
|
|
|
|
|
if(uniqId.equals(otherCodeList.get(i).string(type))) {
|
|
|
|
|
result = otherCodeList.get(i).string("NAME");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|