Commit edf302e7 authored by zhangc's avatar zhangc

修改组织状态

parent 778f2395
...@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j; ...@@ -19,6 +19,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Date; import java.util.Date;
...@@ -60,7 +61,17 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -60,7 +61,17 @@ public class OrganizationManageImpl implements OrganizationManageService {
query.eq("is_deleted", 0); query.eq("is_deleted", 0);
query.ne("status",OrgStatusEnum.CANCEL); query.ne("status",OrgStatusEnum.CANCEL);
query.orderByDesc("create_date"); query.orderByDesc("create_date");
return apiOrgMapper.selectPage(page, query); IPage<ApiOrg> orgIPage = apiOrgMapper.selectPage(page, query);
if (CollectionUtils.isEmpty(orgIPage.getRecords())){
orgIPage.getRecords().forEach(x->{
if (OrgStatusEnum.CANCEL.name().equals(x.getStatus())){
x.setStatus("false");
}else {
x.setStatus("true");
}
});
}
return orgIPage;
} }
/** /**
...@@ -75,7 +86,15 @@ public class OrganizationManageImpl implements OrganizationManageService { ...@@ -75,7 +86,15 @@ public class OrganizationManageImpl implements OrganizationManageService {
query.eq("is_deleted", 0); query.eq("is_deleted", 0);
query.eq("id", req.getId()); query.eq("id", req.getId());
query.ne("status",OrgStatusEnum.CANCEL); query.ne("status",OrgStatusEnum.CANCEL);
return Result.of_success(apiOrgMapper.selectOne(query)); ApiOrg apiOrg = apiOrgMapper.selectOne(query);
if (null == apiOrg) {
if (OrgStatusEnum.CANCEL.name().equals(apiOrg.getStatus())) {
apiOrg.setStatus("false");
} else {
apiOrg.setStatus("true");
}
}
return Result.of_success();
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment