|
|
@@ -4,14 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.zhiqiyun.open.annotation.Permission;
|
|
|
-import com.zhiqiyun.open.core.models.cultural.tourism.OrganizationInfo;
|
|
|
+import com.zhiqiyun.open.core.models.category.CategoryOrganization;
|
|
|
import com.zhiqiyun.open.core.models.user.OauthInfo;
|
|
|
import com.zhiqiyun.open.core.service.OauthService;
|
|
|
-import com.zhiqiyun.open.core.service.OrganizationInfoService;
|
|
|
+import com.zhiqiyun.open.core.service.CategoryOrganizationService;
|
|
|
import com.zhiqiyun.open.core.service.SequenceService;
|
|
|
import com.zhiqiyun.open.mvc.Result;
|
|
|
-import com.zhiqiyun.open.mvc.params.cultural.tourism.QueryOrganizationInfoParam;
|
|
|
-import com.zhiqiyun.open.mvc.params.cultural.tourism.SaveOrganizationInfoParam;
|
|
|
+import com.zhiqiyun.open.mvc.params.category.QueryCategoryOrganizationParam;
|
|
|
+import com.zhiqiyun.open.mvc.params.category.SaveCategoryOrganizationParam;
|
|
|
import com.zhiqiyun.open.utils.DateUtil;
|
|
|
import com.zhiqiyun.open.utils.ServletContext;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
@@ -26,11 +26,11 @@ import javax.validation.Valid;
|
|
|
import java.util.List;
|
|
|
|
|
|
@RestController
|
|
|
-@RequestMapping("/cultural/tourism/organization")
|
|
|
-public class OrganizationController {
|
|
|
+@RequestMapping("/category/organization")
|
|
|
+public class CategoryOrganizationController {
|
|
|
|
|
|
@Autowired
|
|
|
- private OrganizationInfoService organizationInfoService;
|
|
|
+ private CategoryOrganizationService categoryOrganizationService;
|
|
|
|
|
|
@Autowired
|
|
|
private SequenceService sequenceService;
|
|
|
@@ -38,11 +38,11 @@ public class OrganizationController {
|
|
|
@Autowired
|
|
|
private OauthService oauthService;
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.organization.find", tags = "查询文旅机构")
|
|
|
+ @Permission(value = "category.organization.find", tags = "查询文旅机构目录")
|
|
|
@PostMapping("/findPage")
|
|
|
- public Result findPage(@RequestBody QueryOrganizationInfoParam param) {
|
|
|
+ public Result findPage(@RequestBody QueryCategoryOrganizationParam param) {
|
|
|
|
|
|
- QueryWrapper<OrganizationInfo> wrapper = new QueryWrapper<>();
|
|
|
+ QueryWrapper<CategoryOrganization> wrapper = new QueryWrapper<>();
|
|
|
|
|
|
if (StringUtils.isNotBlank(param.getName())) {
|
|
|
wrapper.like("name", param.getName());
|
|
|
@@ -59,19 +59,19 @@ public class OrganizationController {
|
|
|
if (StringUtils.isNotBlank(param.getContactNumber())) {
|
|
|
wrapper.like("contact_number", param.getContactNumber());
|
|
|
}
|
|
|
- Page<OrganizationInfo> page = param.getPage();
|
|
|
+ Page<CategoryOrganization> page = param.getPage();
|
|
|
page.addOrder(OrderItem.desc("id"));
|
|
|
|
|
|
- Page<OrganizationInfo> resultData = this.organizationInfoService.page(page, wrapper);
|
|
|
+ Page<CategoryOrganization> resultData = this.categoryOrganizationService.page(page, wrapper);
|
|
|
|
|
|
return Result.instance(Result.Code.SUCCESS).setData(resultData);
|
|
|
}
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.organization.add", tags = "新建文旅机构")
|
|
|
+ @Permission(value = "category.organization.add", tags = "新建文旅机构目录")
|
|
|
@PostMapping("/save")
|
|
|
- public Result save(@Valid @RequestBody SaveOrganizationInfoParam param) throws Exception {
|
|
|
+ public Result save(@Valid @RequestBody SaveCategoryOrganizationParam param) throws Exception {
|
|
|
|
|
|
- OrganizationInfo entity = new OrganizationInfo();
|
|
|
+ CategoryOrganization entity = new CategoryOrganization();
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
|
|
|
OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
@@ -83,15 +83,15 @@ public class OrganizationController {
|
|
|
entity.setUpdatedBy(oauthInfo.getId());
|
|
|
entity.setId(this.sequenceService.nextId());
|
|
|
|
|
|
- this.organizationInfoService.save(entity);
|
|
|
+ this.categoryOrganizationService.save(entity);
|
|
|
|
|
|
return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
}
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.organization.edit", tags = "更新文旅机构")
|
|
|
+ @Permission(value = "category.organization.edit", tags = "更新文旅机构目录")
|
|
|
@PostMapping("/updateById")
|
|
|
- public Result updateById(Long id, @Valid @RequestBody SaveOrganizationInfoParam param) {
|
|
|
- OrganizationInfo entity = new OrganizationInfo();
|
|
|
+ public Result updateById(Long id, @Valid @RequestBody SaveCategoryOrganizationParam param) {
|
|
|
+ CategoryOrganization entity = new CategoryOrganization();
|
|
|
BeanUtils.copyProperties(param, entity);
|
|
|
|
|
|
OauthInfo oauthInfo = this.oauthService.getAuth(ServletContext.getAccessToken());
|
|
|
@@ -99,15 +99,15 @@ public class OrganizationController {
|
|
|
entity.setUpdatedTime(DateUtil.current());
|
|
|
entity.setId(id);
|
|
|
|
|
|
- this.organizationInfoService.updateById(entity);
|
|
|
+ this.categoryOrganizationService.updateById(entity);
|
|
|
|
|
|
return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
}
|
|
|
|
|
|
- @Permission(value = "cultural.tourism.organization.delete", tags = "删除文旅机构")
|
|
|
+ @Permission(value = "category.organization.delete", tags = "删除文旅机构目录")
|
|
|
@PostMapping("/deleteByIds")
|
|
|
public Result deleteByIds(@RequestBody List<Long> ids) {
|
|
|
- this.organizationInfoService.removeByIds(ids);
|
|
|
+ this.categoryOrganizationService.removeByIds(ids);
|
|
|
return Result.instance(Result.Code.MESSAGE_SUCCESS);
|
|
|
}
|
|
|
}
|