|
|
@ -84,7 +84,12 @@ public class GridForceInfoServiceImpl extends BaseServiceImpl<GridForceInfoDao, |
|
|
|
@Override |
|
|
|
public GridForceInfoDTO get(String id) { |
|
|
|
GridForceInfoEntity entity = baseDao.selectById(id); |
|
|
|
return ConvertUtils.sourceToTarget(entity, GridForceInfoDTO.class); |
|
|
|
GridForceInfoDTO dto = ConvertUtils.sourceToTarget(entity, GridForceInfoDTO.class); |
|
|
|
if(StringUtils.isNotEmpty(entity.getAllDeptIds())){ |
|
|
|
dto.setDeptId(String.valueOf(entity.getDeptId())); |
|
|
|
dto.setSelectedDeptIds(entity.getAllDeptIds().split(",")); |
|
|
|
} |
|
|
|
return dto; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -126,6 +131,11 @@ public class GridForceInfoServiceImpl extends BaseServiceImpl<GridForceInfoDao, |
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
public void update(GridForceInfoDTO dto) { |
|
|
|
GridForceInfoEntity entity = ConvertUtils.sourceToTarget(dto, GridForceInfoEntity.class); |
|
|
|
if (StringUtils.isNotEmpty(dto.getDeptId())) { |
|
|
|
fillDeptInfoByGridId(entity, Long.valueOf(dto.getDeptId())); |
|
|
|
}else { |
|
|
|
throw new RenException("请选择所属部门"); |
|
|
|
} |
|
|
|
updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
|