|
|
@@ -3,6 +3,7 @@ package com.taauav.admin.controller; |
|
|
|
|
|
|
|
import com.taauav.admin.entity.SysCity; |
|
|
|
import com.taauav.admin.service.ILsCityService; |
|
|
|
import com.taauav.admin.service.ISysCityService; |
|
|
|
import com.taauav.common.bean.Response; |
|
|
|
import com.taauav.common.constant.PermissionConstants; |
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
import java.math.BigInteger; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* <p> |
|
|
@@ -26,11 +28,14 @@ import java.math.BigInteger; |
|
|
|
public class LsCityController { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ILsCityService tauvAgencyService; |
|
|
|
private ILsCityService lsCityService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private Response response; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private ISysCityService cityService; |
|
|
|
|
|
|
|
private static final String controllerName = "lscity"; |
|
|
|
|
|
|
|
/** |
|
|
@@ -41,7 +46,7 @@ public class LsCityController { |
|
|
|
@PostMapping("/index") |
|
|
|
@RequiresPermissions(controllerName + ":" + PermissionConstants.LIST_PERMISSION) |
|
|
|
public Response index() { |
|
|
|
return tauvAgencyService.getList(); |
|
|
|
return lsCityService.getList(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -58,7 +63,7 @@ public class LsCityController { |
|
|
|
String message = bindingResult.getFieldError().getDefaultMessage(); |
|
|
|
return response.failure(message); |
|
|
|
} |
|
|
|
return tauvAgencyService.add(entity); |
|
|
|
return lsCityService.add(entity); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -70,7 +75,7 @@ public class LsCityController { |
|
|
|
@GetMapping("/info") |
|
|
|
@RequiresPermissions(controllerName + ":" + PermissionConstants.EDIT_PERMISSION) |
|
|
|
public Response info(BigInteger id) { |
|
|
|
return tauvAgencyService.info(id); |
|
|
|
return lsCityService.info(id); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -87,7 +92,7 @@ public class LsCityController { |
|
|
|
String message = bindingResult.getFieldError().getDefaultMessage(); |
|
|
|
return response.failure(message); |
|
|
|
} |
|
|
|
return tauvAgencyService.edit(entity); |
|
|
|
return lsCityService.edit(entity); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -99,7 +104,7 @@ public class LsCityController { |
|
|
|
@PostMapping("/drop") |
|
|
|
@RequiresPermissions(controllerName + ":" + PermissionConstants.REMOVE_PERMISSION) |
|
|
|
public Response delete(BigInteger id) { |
|
|
|
return tauvAgencyService.delete(id); |
|
|
|
return lsCityService.delete(id); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -111,7 +116,7 @@ public class LsCityController { |
|
|
|
@PostMapping("/setStatus") |
|
|
|
@RequiresPermissions(controllerName + ":" + PermissionConstants.STATUS_PERMISSION) |
|
|
|
public Response setStatus(@RequestBody SysCity entity) { |
|
|
|
return tauvAgencyService.setStatus(entity); |
|
|
|
return lsCityService.setStatus(entity); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@@ -122,7 +127,18 @@ public class LsCityController { |
|
|
|
*/ |
|
|
|
@GetMapping("/getChildCityList") |
|
|
|
public Response getChildCityList(BigInteger pid) { |
|
|
|
return response.success(tauvAgencyService.getChildCityList(pid)); |
|
|
|
return response.success(lsCityService.getChildCityList(pid)); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 获取区划列表 |
|
|
|
* |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/getCityList") |
|
|
|
public Response getCityList() { |
|
|
|
List<SysCity> cityList = cityService.getCityList(BigInteger.valueOf(Long.valueOf("320117"))); |
|
|
|
return response.success(cityList); |
|
|
|
} |
|
|
|
|
|
|
|
} |