| | |
| | | |
| | | import com.jilongda.common.basic.ApiResult; |
| | | import com.jilongda.common.basic.PageInfo; |
| | | import com.jilongda.manage.model.Region; |
| | | import com.jilongda.manage.model.TStore; |
| | | import com.jilongda.manage.query.TStoreQuery; |
| | | import com.jilongda.manage.service.ITRegionService; |
| | | import com.jilongda.manage.service.TStoreService; |
| | | import com.jilongda.manage.utils.LoginInfoUtil; |
| | | import com.jilongda.manage.vo.TStoreVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | private TStoreService storeService; |
| | | @Autowired |
| | | private LoginInfoUtil loginInfoUtil; |
| | | @Autowired |
| | | private ITRegionService regionService; |
| | | |
| | | /** |
| | | * 获取门店列表 |
| | |
| | | @PostMapping(value = "/pageList") |
| | | public ApiResult<PageInfo<TStoreVO>> pageList(@RequestBody TStoreQuery query) { |
| | | Integer userType = loginInfoUtil.getLoginUser().getUserType(); |
| | | if(Objects.equals(userType,2)){ |
| | | if(!Objects.equals(userType,1)){ |
| | | query.setStatus(1); |
| | | } |
| | | return ApiResult.success(storeService.pageList(query)); |
| | | } |
| | | @ApiOperation(value = "省市区三级联动 获取省不传值 市区县传上级code") |
| | | @GetMapping(value = "/list") |
| | | public ApiResult<List<Region>> add(String code) { |
| | | if (!StringUtils.hasLength(code)){ |
| | | return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,0).list()); |
| | | }else{ |
| | | return ApiResult.success(regionService.lambdaQuery().eq(Region::getParentId,regionService.lambdaQuery().eq(Region::getCode,code).one().getId()).list()); |
| | | |
| | | } |
| | | } |
| | | /** |
| | | * 添加门店 |
| | | */ |