Commit e236969f by wubh

包活干V2.2.0-删除无用代码

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@29318 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 71ffb6bd
...@@ -11,7 +11,6 @@ import com.glsx.common.annotation.AuthCheck; ...@@ -11,7 +11,6 @@ import com.glsx.common.annotation.AuthCheck;
import com.glsx.common.annotation.Log; import com.glsx.common.annotation.Log;
import com.glsx.common.constants.Constants; import com.glsx.common.constants.Constants;
import com.glsx.common.constants.ResultObject; import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.StringUtils;
import com.glsx.usercenter.constants.ResultCodeEnum; import com.glsx.usercenter.constants.ResultCodeEnum;
import com.glsx.usercenter.pojo.menu.SysOrganization; import com.glsx.usercenter.pojo.menu.SysOrganization;
import com.glsx.usercenter.pojo.user.SysUser; import com.glsx.usercenter.pojo.user.SysUser;
...@@ -61,49 +60,6 @@ public class OrganizationController extends BaseController { ...@@ -61,49 +60,6 @@ public class OrganizationController extends BaseController {
return result; return result;
} }
/**
* 根据条件查询组织结构
*
* @param organization 请求体
* @return 结果
* @deprecated V2.2.0 已废弃,使用 {@link #getListByParam(SysOrganization)}
*/
@RequestMapping(value = "/getByParams2", method = {RequestMethod.GET, RequestMethod.POST})
public ResultObject getByParams2(SysOrganization organization) {
logger.info("/getByParams2 param: {}", JSON.toJSONString(organization));
ResultObject result;
SysUser currentUser = ShiroUtil.getUser();
Integer orgId = organization.getId();
String orgName = StringUtils.isNotBlank(organization.getName())
? organization.getName().replaceAll(" ", "") : "";
Byte orgStatus = organization.getOrgStatus();
List<SysOrganization> organizationList;
if (StringUtils.isNotBlank(orgName)) {
// 根据 name 和 orgStatus 搜索
organizationList = organizationService.selectByExample(orgName, orgStatus, currentUser);
} else if (orgId != null && orgStatus != null) {
// 根据 id 和 orgStatus 递归查询子菜单
SysOrganization record = new SysOrganization();
record.setId(orgId);
record.setOrgStatus(orgStatus);
organizationList = organizationService.findOrgByRecord(record);
} else if (orgId != null) {
// 根据 id 递归查询子菜单
organizationList = organizationService.findOrgById(orgId);
} else {
// orgStatus 不为空则根据状态查询,如果为空则只查询一级菜单
organizationList = organizationService.selectByExample(null, orgStatus,
currentUser);
}
result = new ResultObject(ResultCodeEnum.SUCCESS.getCode(),
ResultCodeEnum.SUCCESS.getMsg(), organizationList);
return result;
}
@Log(menuName = "系统管理-组织管理", operateType = Constants.SYS_LOG_OPERATE_TYPE_SAVE) @Log(menuName = "系统管理-组织管理", operateType = Constants.SYS_LOG_OPERATE_TYPE_SAVE)
@RequestMapping(value = "/add", method = {RequestMethod.GET, RequestMethod.POST}) @RequestMapping(value = "/add", method = {RequestMethod.GET, RequestMethod.POST})
public ResultObject add(SysOrganization sysOrganization) { public ResultObject add(SysOrganization sysOrganization) {
......
...@@ -24,8 +24,6 @@ public interface ISysOrganizationService { ...@@ -24,8 +24,6 @@ public interface ISysOrganizationService {
List<SysOrganization> getListByParam(SysOrganization organization, SysUser user); List<SysOrganization> getListByParam(SysOrganization organization, SysUser user);
List<SysOrganization> selectByExample(String orgName, Byte orgStatus, SysUser user);
SysOrganization selectByPrimaryKey(Integer id); SysOrganization selectByPrimaryKey(Integer id);
int updateByPrimaryKeySelective(SysOrganization record); int updateByPrimaryKeySelective(SysOrganization record);
......
...@@ -145,6 +145,7 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService { ...@@ -145,6 +145,7 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService {
/** /**
* 根据条件查询组织结构 * 根据条件查询组织结构
* V2.2.0合并部分方法,rev 29250
* *
* @param organization 请求体 * @param organization 请求体
* @return 结果 * @return 结果
...@@ -221,54 +222,6 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService { ...@@ -221,54 +222,6 @@ public class SysOrganizationServiceImpl implements ISysOrganizationService {
} }
/** /**
* @deprecated V2.2.0 已废弃
*/
@Override
@Deprecated
public List<SysOrganization> selectByExample(String orgName, Byte orgStatus, SysUser user) {
SysOrganizationExample example = new SysOrganizationExample();
Criteria criteria = example.createCriteria();
List<Integer> ids;
if (Constants.USER_TYPE_MANAGER != user.getId()) {
ids = organizationMapper.selectOrgByUserId(user.getId());
if (ids.isEmpty()) {
logger.info("当前用户未指定组织,userId: {}", user.getId());
return null;
}
criteria.andIdIn(ids);
}
List<SysOrganization> organizationList;
if (orgStatus != null && orgName != null) {
// 根据名字和状态搜索
criteria.andOrgStatusEqualTo(orgStatus);
example.setOrderByClause("sort asc");
organizationList = organizationMapper.selectByExample(example);
return convertListToTreeByKeyword(organizationList, orgName);
} else if (orgName != null) {
// 根据名字搜索
// criteria.andNameLike(name+"%");
criteria.andOrgStatusIn(Arrays.asList((byte) 1, (byte) 2));
organizationList = organizationMapper.selectByExample(example);
return convertListToTreeByKeyword(organizationList, orgName);
} else if (orgStatus != null) {
// 根据状态搜索
// criteria.andNameLike(name+"%");
criteria.andOrgStatusEqualTo(orgStatus);
organizationList = organizationMapper.selectByExample(example);
return convertListToTree(organizationList);
} else {
// 仅查询一级菜单
criteria.andOrgStatusIn(Arrays.asList((byte) 1, (byte) 2));
criteria.andParentIdEqualTo(0);
example.setOrderByClause("sort asc");
// 查询当前用户的
return organizationMapper.selectByExample(example);
}
}
/**
* *
*/ */
@Override @Override
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!