|
@@ -1,59 +0,0 @@
|
|
|
-package com.fs.hisStore.controller;
|
|
|
-
|
|
|
-import com.fs.common.core.controller.BaseController;
|
|
|
-import com.fs.common.core.domain.R;
|
|
|
-import com.fs.hisStore.domain.FsCityScrm;
|
|
|
-import com.fs.hisStore.service.IFsCityScrmService;
|
|
|
-import com.fs.store.utils.CityTreeUtil;
|
|
|
-import com.fs.store.vo.CityVO;
|
|
|
-import com.google.common.collect.Lists;
|
|
|
-import io.swagger.annotations.ApiOperation;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-import springfox.documentation.annotations.Cacheable;
|
|
|
-
|
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
-import java.util.List;
|
|
|
-
|
|
|
-/**
|
|
|
- * 城市Controller
|
|
|
- *
|
|
|
- * @author fs
|
|
|
- * @date 2022-03-15
|
|
|
- */
|
|
|
-@RestController
|
|
|
-@RequestMapping("/store/store/city")
|
|
|
-public class FsCityScrmController extends BaseController
|
|
|
-{
|
|
|
- @Autowired
|
|
|
- private IFsCityScrmService fsCityService;
|
|
|
-
|
|
|
-//
|
|
|
-// @GetMapping("/getAllList")
|
|
|
-// @Cacheable("citys")
|
|
|
-// public R getAllList(FsCityScrm fsCity)
|
|
|
-// {
|
|
|
-// List<FsCityScrm> list = fsCityService.selectFsCityList(fsCity);
|
|
|
-// return R.ok().put("data",list);
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
- @ApiOperation("获取城市数据")
|
|
|
- @GetMapping("/getCitys")
|
|
|
- @Cacheable("citys")
|
|
|
- public R getCitys(HttpServletRequest request){
|
|
|
- List<FsCityScrm> list=fsCityService.selectFsCitys();
|
|
|
- List<CityVO> cityVOS = Lists.newArrayList();
|
|
|
- for (FsCityScrm city : list){
|
|
|
- CityVO cityVO = new CityVO();
|
|
|
- cityVO.setValue(Long.parseLong(city.getCityId()));
|
|
|
- cityVO.setLabel(city.getCityName());
|
|
|
- cityVO.setPid(Long.parseLong(city.getParentId()));
|
|
|
- cityVOS.add(cityVO);
|
|
|
- }
|
|
|
- return R.ok().put("data", CityTreeUtil.list2TreeConverter(cityVOS, 0));
|
|
|
-
|
|
|
- }
|
|
|
-}
|