From f7e51fc7c91e474e5c0bcc79c47f074c0a59b5c3 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期三, 11 十月 2023 20:03:35 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- cloud-server-account/src/main/java/com/dsh/account/controller/CityManagerController.java | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/CityManagerController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/CityManagerController.java index 4949042..769246e 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/controller/CityManagerController.java +++ b/cloud-server-account/src/main/java/com/dsh/account/controller/CityManagerController.java @@ -1,8 +1,20 @@ package com.dsh.account.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dsh.account.entity.CityManager; +import com.dsh.account.entity.TStoreStaff; +import com.dsh.account.feignclient.other.model.Store; import com.dsh.account.service.ICityManagerService; +import com.dsh.account.service.TStoreStaffService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.TreeSet; +import java.util.stream.Collectors; /** * @author zhibing.pu @@ -12,7 +24,52 @@ @RequestMapping("") public class CityManagerController { + @Resource private ICityManagerService cityManagerService; + @Autowired + private TStoreStaffService storeStaffService; + + /** + * 根据管理员id获取详情信息 + */ + @RequestMapping("/cityManager/getStoreById") + public CityManager getStoreById(@RequestParam Integer id){ + return cityManagerService.getOne(new QueryWrapper<CityManager>().eq("id",id)); + } + /** + * 获取已有城市管理的省、市 + */ + @RequestMapping("/cityManager/listAll") + + public List<CityManager> listAll(){ + return cityManagerService.listAll(); + } + /** + * 选择省 展示市 + */ + @RequestMapping("/cityManager/getCity") + @ResponseBody + public List<CityManager> getCity(@RequestBody String province){ + List<CityManager> province1 = cityManagerService.list(new QueryWrapper<CityManager>().eq("province", province)); + List<CityManager> distinctCities = province1.stream() + .collect(Collectors.collectingAndThen( + Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(CityManager::getCity))), + ArrayList::new + )); + + return distinctCities; + } + + /** + * 选择市区 展示全部账号 + */ + @RequestMapping("/cityManager/getAccount") + @ResponseBody + public List<CityManager> getAccount(@RequestBody String city){ + return cityManagerService.list(new QueryWrapper<CityManager>().eq("city",city).ne("state",2).ne("state",3)); + } + + /** @@ -25,4 +82,5 @@ public CityManager queryCityManagerById(@RequestBody Integer id){ return cityManagerService.getById(id); } + } -- Gitblit v1.7.1