|
|
@@ -16,10 +16,7 @@ import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
|
import org.springframework.data.web.PageableDefault;
|
|
|
import org.springframework.util.Assert;
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
+import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@@ -32,8 +29,8 @@ public class OrganizationController {
|
|
|
private OrganizationService organizationService;
|
|
|
|
|
|
//------------------------------项目管理 start----------------------
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
- @ResourceAuth(value = AuthConstant.SuperAdmin,type = AuthType.Platform)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @ResourceAuth(value = AuthConstant.SuperAdmin, type = AuthType.Platform)
|
|
|
@Operation(summary = "项目-添加", description = "项目-添加")
|
|
|
@RequestMapping(value = "addProject", method = {RequestMethod.POST})
|
|
|
public ResultContent addProject(@RequestBody OrganizationAddParam param) {
|
|
|
@@ -41,8 +38,8 @@ public class OrganizationController {
|
|
|
return this.organizationService.addOrganization(param);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
- @ResourceAuth(value = AuthConstant.SuperAdmin,type = AuthType.Platform)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @ResourceAuth(value = AuthConstant.SuperAdmin, type = AuthType.Platform)
|
|
|
@Operation(summary = "项目列表-分页查询", description = "项目列表-分页查询")
|
|
|
@RequestMapping(value = {"pageProject"}, method = {RequestMethod.POST})
|
|
|
public ResultContent<Page<OrganizationModel>> pageProject(
|
|
|
@@ -52,12 +49,26 @@ public class OrganizationController {
|
|
|
return organizationService.pageProject(param, pageable);
|
|
|
}
|
|
|
|
|
|
+ @Operation(summary = "得到平台管理端的机构数据", description = "得到平台管理端的机构数据")
|
|
|
+ @RequestMapping(value = "getPlatformInfo", method = {RequestMethod.GET})
|
|
|
+ public ResultContent<OrganizationModel> getPlatformInfo() {
|
|
|
+ return this.organizationService.getPlatformInfo();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @Operation(summary = "得到机构详情", description = "得到机构详情--学校、商户")
|
|
|
+ @RequestMapping(value = "getOrgDetail", method = {RequestMethod.GET})
|
|
|
+ public ResultContent<OrganizationModel> getOrgDetail(@Parameter(name = "oid", description = "机构oid", example = "") @RequestParam("oid") String oid) {
|
|
|
+ Assert.hasText(oid, "oid不能为空");
|
|
|
+ return this.organizationService.getOrgDetail(oid);
|
|
|
+ }
|
|
|
+
|
|
|
//------------------------------项目管理 end------------------------
|
|
|
|
|
|
//------------------------------学校管理 start----------------------
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
- @ResourceAuth(value = AuthConstant.SuperAdmin,type = AuthType.Platform)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @ResourceAuth(value = AuthConstant.SuperAdmin, type = AuthType.Platform)
|
|
|
@Operation(summary = "学校-添加", description = "学校-添加")
|
|
|
@RequestMapping(value = "addSchool", method = {RequestMethod.POST})
|
|
|
public ResultContent addSchool(@RequestBody SchoolAddParam param) {
|
|
|
@@ -65,7 +76,7 @@ public class OrganizationController {
|
|
|
return this.organizationService.addSchool(param);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "学校-编辑", description = "学校-编辑")
|
|
|
@RequestMapping(value = "updateSchool", method = {RequestMethod.POST})
|
|
|
public ResultContent updateSchool(@RequestBody SchoolUpdateParam param) {
|
|
|
@@ -73,7 +84,7 @@ public class OrganizationController {
|
|
|
return this.organizationService.updateSchool(param);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "学校列表-分页查询", description = "学校列表-分页查询")
|
|
|
@RequestMapping(value = {"pageSchool"}, method = {RequestMethod.POST})
|
|
|
public ResultContent<Page<OrganizationModel>> pageSchool(
|
|
|
@@ -82,12 +93,29 @@ public class OrganizationController {
|
|
|
param.setAuthType(AuthType.School);
|
|
|
return organizationService.page(param, pageable);
|
|
|
}
|
|
|
+
|
|
|
+ @Operation(summary = "得到可用的学校数据", description = "得到可用的学校数据")
|
|
|
+ @RequestMapping(value = {"getUsableSchool"}, method = {RequestMethod.POST})
|
|
|
+ public ResultContent<List<OrganizationSimpleModel>> getUsableSchool(
|
|
|
+ @Parameter(required = false) OrganizationSearchParam param) {
|
|
|
+ param.setAuthType(AuthType.School);
|
|
|
+ return organizationService.list(param);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "得到可用的商户数据", description = "得到可用的商户数据")
|
|
|
+ @RequestMapping(value = {"getUsableShop"}, method = {RequestMethod.POST})
|
|
|
+ public ResultContent<List<OrganizationSimpleModel>> getUsableShop(
|
|
|
+ @Parameter(required = false) OrganizationSearchParam param) {
|
|
|
+ param.setAuthType(AuthType.Shop);
|
|
|
+ return organizationService.list(param);
|
|
|
+ }
|
|
|
+
|
|
|
//------------------------------学校管理 end------------------------
|
|
|
|
|
|
//------------------------------商户管理 start----------------------
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
- @ResourceAuth(value = AuthConstant.SuperAdmin,type = AuthType.Platform)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @ResourceAuth(value = AuthConstant.SuperAdmin, type = AuthType.Platform)
|
|
|
@Operation(summary = "商户-添加", description = "商户-添加")
|
|
|
@RequestMapping(value = "addShop", method = {RequestMethod.POST})
|
|
|
public ResultContent addShop(@RequestBody OrganizationAddParam param) {
|
|
|
@@ -95,7 +123,7 @@ public class OrganizationController {
|
|
|
return this.organizationService.addOrganization(param);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "商户-编辑", description = "商户-编辑")
|
|
|
@RequestMapping(value = "updateShop", method = {RequestMethod.POST})
|
|
|
public ResultContent updateShop(@RequestBody OrganizationUpdateParam param) {
|
|
|
@@ -103,7 +131,7 @@ public class OrganizationController {
|
|
|
return this.organizationService.update(param);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "商户列表-分页查询", description = "商户列表-分页查询")
|
|
|
@RequestMapping(value = {"pageShop"}, method = {RequestMethod.POST})
|
|
|
public ResultContent<Page<OrganizationModel>> pageShop(
|
|
|
@@ -114,23 +142,23 @@ public class OrganizationController {
|
|
|
}
|
|
|
//------------------------------商户管理 end------------------------
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
- @ResourceAuth(value = AuthConstant.SuperAdmin,type = AuthType.Platform)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @ResourceAuth(value = AuthConstant.SuperAdmin, type = AuthType.Platform)
|
|
|
@Operation(summary = "项目-学校-商家-删除", description = "项目-学校-商家-删除")
|
|
|
@RequestMapping(value = "delete", method = {RequestMethod.POST})
|
|
|
public ResultContent delete(@RequestBody OidModel param) {
|
|
|
return this.organizationService.deleteOrganization(param.getOid());
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
- @ResourceAuth(value = AuthConstant.SuperAdmin,type = AuthType.Platform)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
+ @ResourceAuth(value = AuthConstant.SuperAdmin, type = AuthType.Platform)
|
|
|
@Operation(summary = "添加机构", description = "添加机构")
|
|
|
@RequestMapping(value = "add", method = {RequestMethod.POST})
|
|
|
public ResultContent add(@RequestBody OrganizationAddParam param) {
|
|
|
return this.organizationService.addOrganization(param);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "编辑机构-项目-学校", description = "编辑机构-项目-学校")
|
|
|
@RequestMapping(value = "update", method = {RequestMethod.POST})
|
|
|
public ResultContent update(@RequestBody OrganizationUpdateParam param) {
|
|
|
@@ -138,14 +166,14 @@ public class OrganizationController {
|
|
|
return this.organizationService.update(param);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "项目编码生成器", description = "项目编码生成器")
|
|
|
@RequestMapping(value = "buildProjectCode", method = {RequestMethod.GET})
|
|
|
public ResultContent buildProjectCode() {
|
|
|
return this.organizationService.buildCode(AuthType.Project);
|
|
|
}
|
|
|
|
|
|
- @ResourceAuth(value = "user",type = AuthType.User)
|
|
|
+ @ResourceAuth(value = "user", type = AuthType.User)
|
|
|
@Operation(summary = "查询所有可用的项目列表", description = "查询所有可用的项目列表")
|
|
|
@RequestMapping(value = "getProjectList", method = {RequestMethod.GET})
|
|
|
public ResultContent<List<OrganizationModel>> getProjectList() {
|