Commit b84a3380 by zhengxj

finish 删除组织 on 20190225 by zhengxj

git-svn-id: svn://192.168.3.233/frms/code/car-service/trunk/car-service@17741 aeb6102e-e053-11e5-9fec-f9ebc45caf4b
1 parent 21a57e44
......@@ -101,11 +101,11 @@ public class OrganizationController extends BaseController{
}
@RequestMapping(value = "/deleteById", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject deleteById(@RequestParam(value = "id", required = false) Integer id) {
if (id == null) {
public ResultObject deleteById(@RequestBody SysOrganization organization) {
if (organization==null||organization.getId() == null) {
return new ResultObject(ResultCodeEnum.FAIL.getCode(), ResultCodeEnum.FAIL);
}
int i = organizationService.deleteByPrimaryKey(id);
int i = organizationService.deleteByPrimaryKey(organization.getId());
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);
......@@ -119,11 +119,11 @@ public class OrganizationController extends BaseController{
}
@RequestMapping(value = "/selectDetailById", method = { RequestMethod.GET, RequestMethod.POST })
public ResultObject selectDetailById(@RequestParam Integer id) {
if (id == null) {
public ResultObject selectDetailById(@RequestBody SysOrganization organization) {
if (organization == null) {
return new ResultObject(ResultCodeEnum.FAIL.getCode(), ResultCodeEnum.FAIL);
}
SysOrganization sysOrganization =organizationService.selectByPrimaryKey(id);
SysOrganization sysOrganization =organizationService.selectByPrimaryKey(organization.getId() );
SysOrganization parent=organizationService.selectByPrimaryKey(sysOrganization.getParentId());
if(parent!=null){
sysOrganization.setParentName(parent.getName());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!