Commit ca1c69ca by zhengxj

finish 修复bug17088 on 20190314 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@18512 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 5880ab2a
......@@ -121,9 +121,9 @@ public class OrganizationController extends BaseController{
@Log(menuName="系统管理-组织管理", operateType = Constants.SYS_LOG_OPERATE_TYPE_UPDATE)
@RequestMapping(value = "/update", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject update( SysOrganization sysOrganization) {
public ResultObject update(SysOrganization sysOrganization) {
sysOrganization.setUpdateTime(new Date());
organizationService.updateByPrimaryKeySelective(sysOrganization);
organizationService.updateByPrimaryKeySelective(sysOrganization);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(), ResultCodeEnum.SUCCESS.getMsg());
}
......
......@@ -89,11 +89,8 @@ public class SysMenuController extends BaseController {
public ResultObject deleteById(@RequestParam(value = "id", required = false) Integer id) {
if (id == null) {
return new ResultObject(ResultCodeEnum.FAIL.getCode(), ResultCodeEnum.FAIL);
}
int i = menuService.deleteByPrimaryKey(id);
String msg = i == 0 ? ResultCodeEnum.FAIL.getMsg() : ResultCodeEnum.SUCCESS.getMsg();
int code = i == 0 ? ResultCodeEnum.FAIL.getCode() : ResultCodeEnum.SUCCESS.getCode();
return new ResultObject(code, msg);
}
return menuService.deleteByPrimaryKey(id);
}
@Log(menuName="系统管理-菜单管理", operateType = Constants.SYS_LOG_OPERATE_TYPE_UPDATE)
......
......@@ -6,6 +6,7 @@ package com.glsx.usercenter.service;
import java.util.List;
import java.util.Map;
import com.glsx.common.constants.ResultObject;
import com.glsx.usercenter.pojo.menu.SysMenu;
import com.glsx.usercenter.pojo.menu.SysMenuExample;
......@@ -22,7 +23,7 @@ public interface ISysMenuService {
long countByExample(SysMenuExample example);
int deleteByPrimaryKey(Integer id);
ResultObject deleteByPrimaryKey(Integer id);
int insertSelective(SysMenu sysMenu);
......
......@@ -12,6 +12,8 @@ import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.glsx.common.constants.ResultCodeEnum;
import com.glsx.common.constants.ResultObject;
import com.glsx.common.utils.StringUtils;
import com.glsx.usercenter.constants.Constants;
import com.glsx.usercenter.mapper.SysMenuMapper;
......@@ -42,7 +44,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
@Override
public int deleteByPrimaryKey(Integer id) {
public ResultObject deleteByPrimaryKey(Integer id) {
SysMenuExample example = new SysMenuExample();
example.createCriteria().andParentIdEqualTo(id);
List<SysMenu> list = menuDao.selectByExample(example);
......@@ -52,9 +54,10 @@ public class SysMenuServiceImpl implements ISysMenuService {
record.setId(id);
record.setUpdateTime(new Date());
record.setMenuStatus((byte)2);
return menuDao.updateByPrimaryKeySelective(record);
menuDao.updateByPrimaryKeySelective(record);
return new ResultObject(ResultCodeEnum.SUCCESS.getCode(),"");
}
return 0;
return new ResultObject(ResultCodeEnum.FAIL.getCode(),"该菜单下仍有子菜单,暂不支持删除操作!!");
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!