|
|
@ -1,6 +1,7 @@
|
|
|
|
package cokr.xit.fims.base.service.bean;
|
|
|
|
package cokr.xit.fims.base.service.bean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
@ -8,7 +9,11 @@ import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import cokr.xit.base.user.DepartmentQuery;
|
|
|
|
|
|
|
|
import cokr.xit.base.user.SigunguQuery;
|
|
|
|
import cokr.xit.base.user.dao.UserMapper;
|
|
|
|
import cokr.xit.base.user.dao.UserMapper;
|
|
|
|
|
|
|
|
import cokr.xit.base.user.service.bean.DepartmentBean;
|
|
|
|
|
|
|
|
import cokr.xit.base.user.service.bean.SigunguBean;
|
|
|
|
import cokr.xit.fims.base.FimsDepartment;
|
|
|
|
import cokr.xit.fims.base.FimsDepartment;
|
|
|
|
import cokr.xit.fims.base.FimsSigungu;
|
|
|
|
import cokr.xit.fims.base.FimsSigungu;
|
|
|
|
import cokr.xit.fims.base.OgdpQuery;
|
|
|
|
import cokr.xit.fims.base.OgdpQuery;
|
|
|
@ -21,7 +26,11 @@ import cokr.xit.foundation.data.DataObject;
|
|
|
|
@Component("ogdpBean")
|
|
|
|
@Component("ogdpBean")
|
|
|
|
public class OgdpBean extends AbstractBean {
|
|
|
|
public class OgdpBean extends AbstractBean {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name="sigunguBean")
|
|
|
|
|
|
|
|
private SigunguBean sigunguBean;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name="departmentBean")
|
|
|
|
|
|
|
|
private DepartmentBean departmentBean;
|
|
|
|
|
|
|
|
|
|
|
|
@Resource(name="ogdpMapper")
|
|
|
|
@Resource(name="ogdpMapper")
|
|
|
|
private OgdpMapper ogdpMapper;
|
|
|
|
private OgdpMapper ogdpMapper;
|
|
|
@ -31,11 +40,75 @@ public class OgdpBean extends AbstractBean {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Object selectAllOgdpList() {
|
|
|
|
public Object selectAllOgdpList() {
|
|
|
|
return ogdpMapper.selectAllOgdpList();
|
|
|
|
List<DataObject> ogdpList = new ArrayList<>();
|
|
|
|
|
|
|
|
List<DataObject> sggs = sigunguBean.getSigunguList(new SigunguQuery());
|
|
|
|
|
|
|
|
for(DataObject sgg : sggs) {
|
|
|
|
|
|
|
|
List<DataObject> depts = departmentBean.getDepartmentList(new DepartmentQuery().setSggID(sgg.string("SGG_CD")));
|
|
|
|
|
|
|
|
for(DataObject dept : depts) {
|
|
|
|
|
|
|
|
DataObject ogdp = new DataObject();
|
|
|
|
|
|
|
|
ogdp.put("SGG_CD", sgg.string("SGG_CD"));
|
|
|
|
|
|
|
|
ogdp.put("SGG_NM", sgg.string("SGG_NM"));
|
|
|
|
|
|
|
|
ogdp.put("INST_CD", sgg.string("INST_CD"));
|
|
|
|
|
|
|
|
ogdp.put("INST_NM", sgg.string("INST_NM"));
|
|
|
|
|
|
|
|
ogdp.put("DEPT_CD", dept.string("DEPT_CD"));
|
|
|
|
|
|
|
|
ogdp.put("DEPT_NM", dept.string("DEPT_NM"));
|
|
|
|
|
|
|
|
ogdp.put("OGDP_CD", sgg.string("INST_CD") + "/" + dept.string("DEPT_CD"));
|
|
|
|
|
|
|
|
ogdp.put("OGDP_NM", sgg.string("SGG_NM") + " / " + sgg.string("INST_NM") + " : " + dept.string("DEPT_NM"));
|
|
|
|
|
|
|
|
ogdpList.add(ogdp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
DataObject sysAdmin = new DataObject();
|
|
|
|
|
|
|
|
sysAdmin.put("SGG_CD", "default");
|
|
|
|
|
|
|
|
sysAdmin.put("SGG_NM", "기본 시군구");
|
|
|
|
|
|
|
|
sysAdmin.put("INST_CD", "default");
|
|
|
|
|
|
|
|
sysAdmin.put("INST_NM", "기본 기관");
|
|
|
|
|
|
|
|
sysAdmin.put("DEPT_CD", "default");
|
|
|
|
|
|
|
|
sysAdmin.put("DEPT_NM", "기본 부서");
|
|
|
|
|
|
|
|
sysAdmin.put("OGDP_CD", "default/default");
|
|
|
|
|
|
|
|
sysAdmin.put("OGDP_NM", "기본 시군구 / 기본 기관 : 기본 부서");
|
|
|
|
|
|
|
|
ogdpList.add(sysAdmin);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ogdpList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public List<DataObject> selectAbleOgdpList(DataObject params) {
|
|
|
|
public List<DataObject> selectAbleOgdpList(boolean anonymous, String sggCd) {
|
|
|
|
return ogdpMapper.selectAbleOgdpList(params);
|
|
|
|
List<DataObject> ogdpList = new ArrayList<>();
|
|
|
|
|
|
|
|
SigunguQuery sggQuery = new SigunguQuery();
|
|
|
|
|
|
|
|
if(anonymous) {
|
|
|
|
|
|
|
|
sggQuery.setSggIDs(sggCd);
|
|
|
|
|
|
|
|
} else if(!currentUser().getInstitute().equals("default")){
|
|
|
|
|
|
|
|
sggQuery.setSggIDs(currentUser().getOrgID());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
List<DataObject> sggs = sigunguBean.getSigunguList(sggQuery);
|
|
|
|
|
|
|
|
for(DataObject sgg : sggs) {
|
|
|
|
|
|
|
|
List<DataObject> depts = departmentBean.getDepartmentList(new DepartmentQuery().setSggID(sgg.string("SGG_CD")));
|
|
|
|
|
|
|
|
for(DataObject dept : depts) {
|
|
|
|
|
|
|
|
DataObject ogdp = new DataObject();
|
|
|
|
|
|
|
|
ogdp.put("SGG_CD", sgg.string("SGG_CD"));
|
|
|
|
|
|
|
|
ogdp.put("SGG_NM", sgg.string("SGG_NM"));
|
|
|
|
|
|
|
|
ogdp.put("INST_CD", sgg.string("INST_CD"));
|
|
|
|
|
|
|
|
ogdp.put("INST_NM", sgg.string("INST_NM"));
|
|
|
|
|
|
|
|
ogdp.put("DEPT_CD", dept.string("DEPT_CD"));
|
|
|
|
|
|
|
|
ogdp.put("DEPT_NM", dept.string("DEPT_NM"));
|
|
|
|
|
|
|
|
ogdp.put("OGDP_CD", sgg.string("INST_CD") + "/" + dept.string("DEPT_CD"));
|
|
|
|
|
|
|
|
ogdp.put("OGDP_NM", sgg.string("SGG_NM") + " / " + sgg.string("INST_NM") + " : " + dept.string("DEPT_NM"));
|
|
|
|
|
|
|
|
ogdpList.add(ogdp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!anonymous && currentUser().getInstitute().equals("default")) {
|
|
|
|
|
|
|
|
DataObject sysAdmin = new DataObject();
|
|
|
|
|
|
|
|
sysAdmin.put("SGG_CD", "default");
|
|
|
|
|
|
|
|
sysAdmin.put("SGG_NM", "기본 시군구");
|
|
|
|
|
|
|
|
sysAdmin.put("INST_CD", "default");
|
|
|
|
|
|
|
|
sysAdmin.put("INST_NM", "기본 기관");
|
|
|
|
|
|
|
|
sysAdmin.put("DEPT_CD", "default");
|
|
|
|
|
|
|
|
sysAdmin.put("DEPT_NM", "기본 부서");
|
|
|
|
|
|
|
|
sysAdmin.put("OGDP_CD", "default/default");
|
|
|
|
|
|
|
|
sysAdmin.put("OGDP_NM", "기본 시군구 / 기본 기관 : 기본 부서");
|
|
|
|
|
|
|
|
ogdpList.add(sysAdmin);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return ogdpList;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public int countUser(String sggCd) {
|
|
|
|
public int countUser(String sggCd) {
|
|
|
|