|
|
@@ -2,6 +2,7 @@ package com.zhongshu.card.server.core.service.school;
|
|
|
|
|
|
import com.zhongshu.card.client.model.school.AreaModel;
|
|
|
import com.zhongshu.card.client.model.school.AreaParam;
|
|
|
+import com.zhongshu.card.client.model.school.DictInfoParam;
|
|
|
import com.zhongshu.card.client.ret.ResultContent;
|
|
|
import com.zhongshu.card.client.ret.ResultMessage;
|
|
|
import com.zhongshu.card.client.service.school.AreaService;
|
|
|
@@ -10,8 +11,10 @@ import com.zhongshu.card.client.utils.TreeUtil;
|
|
|
import com.zhongshu.card.client.utils.type.DataState;
|
|
|
import com.zhongshu.card.server.core.dao.school.AreaDao;
|
|
|
import com.zhongshu.card.server.core.dao.school.CollegeDao;
|
|
|
+import com.zhongshu.card.server.core.dao.school.DictInfoDao;
|
|
|
import com.zhongshu.card.server.core.domain.school.Area;
|
|
|
import com.zhongshu.card.server.core.domain.school.College;
|
|
|
+import com.zhongshu.card.server.core.domain.school.DictInfo;
|
|
|
import com.zhongshu.card.server.core.service.base.SuperService;
|
|
|
import com.zhongshu.card.server.core.util.BeanUtils;
|
|
|
import com.zhongshu.card.server.core.util.CommonUtil;
|
|
|
@@ -35,6 +38,9 @@ public class AreaServiceImpl extends SuperService implements AreaService {
|
|
|
@Autowired
|
|
|
AreaDao areaDao;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ DictInfoDao dictInfoDao;
|
|
|
+
|
|
|
/**
|
|
|
* 添加院级
|
|
|
*
|
|
|
@@ -42,7 +48,7 @@ public class AreaServiceImpl extends SuperService implements AreaService {
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public ResultContent<College> addArea(AreaParam param) {
|
|
|
+ public ResultContent<Area> addArea(AreaParam param) {
|
|
|
initDefaultUserAndOid(param);
|
|
|
|
|
|
if (CommonUtil.longIsEmpty(param.getSort())) {
|
|
|
@@ -82,6 +88,8 @@ public class AreaServiceImpl extends SuperService implements AreaService {
|
|
|
entity = new Area();
|
|
|
}
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
+ DictInfo dictInfo = dictInfoDao.findTopById(param.getDictInfoId());
|
|
|
+ entity.setDictInfo(dictInfo);
|
|
|
areaDao.save(entity);
|
|
|
return ResultContent.buildSuccess(entity);
|
|
|
}
|
|
|
@@ -128,6 +136,12 @@ public class AreaServiceImpl extends SuperService implements AreaService {
|
|
|
AreaModel model = new AreaModel();
|
|
|
if (ObjectUtils.isNotEmpty(entity)) {
|
|
|
BeanUtils.copyProperties(entity, model);
|
|
|
+ DictInfo dictInfo = entity.getDictInfo();
|
|
|
+ if (dictInfo != null) {
|
|
|
+ DictInfoParam param = new DictInfoParam();
|
|
|
+ BeanUtils.copyProperties(dictInfo, param);
|
|
|
+ model.setDictInfo(param);
|
|
|
+ }
|
|
|
}
|
|
|
return model;
|
|
|
}
|