修改区域管理模块
This commit is contained in:
		@@ -1,9 +1,7 @@
 | 
			
		||||
package com.atguigu.ssyx.sys;
 | 
			
		||||
package com.atguigu.ssyx;
 | 
			
		||||
 | 
			
		||||
import org.mybatis.spring.annotation.MapperScan;
 | 
			
		||||
import org.springframework.boot.SpringApplication;
 | 
			
		||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * ClassName: ServiceSysApplication
 | 
			
		||||
@@ -13,8 +11,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
 | 
			
		||||
 * @Create 2023/9/14 15:36
 | 
			
		||||
 */
 | 
			
		||||
@SpringBootApplication
 | 
			
		||||
@EnableSwagger2WebMvc
 | 
			
		||||
@MapperScan(value = "com.atguigu.ssyx.*.mapper")
 | 
			
		||||
public class ServiceSysApplication {
 | 
			
		||||
    public static void main(String[] args) {
 | 
			
		||||
        SpringApplication.run(ServiceSysApplication.class, args);
 | 
			
		||||
@@ -7,10 +7,7 @@ import com.atguigu.ssyx.sys.service.RegionService;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
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.PathVariable;
 | 
			
		||||
import org.springframework.web.bind.annotation.RequestMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
@@ -25,7 +22,7 @@ import java.util.List;
 | 
			
		||||
@Api(value = "地区接口", tags = "地区接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping("/admin/sys/region")
 | 
			
		||||
//@CrossOrigin
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
public class RegionController {
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
 
 | 
			
		||||
@@ -10,10 +10,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import io.swagger.annotations.Api;
 | 
			
		||||
import io.swagger.annotations.ApiOperation;
 | 
			
		||||
import io.swagger.annotations.ApiParam;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.web.bind.annotation.*;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 城市仓库关联表 前端控制器
 | 
			
		||||
@@ -22,23 +21,21 @@ import javax.annotation.Resource;
 | 
			
		||||
 * @author atguigu
 | 
			
		||||
 * @since 2023-09-14
 | 
			
		||||
 */
 | 
			
		||||
@Api(value = "开通区域接口", tags = "开通区域接口")
 | 
			
		||||
@RestController
 | 
			
		||||
@RequestMapping(value = "/admin/sys/regionWare")
 | 
			
		||||
@Api(value = "开通区域接口", tags = "开通区域接口")
 | 
			
		||||
@CrossOrigin
 | 
			
		||||
public class RegionWareController {
 | 
			
		||||
    @Resource
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private RegionWareService regionWareService;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    //TODO 分页查询错误
 | 
			
		||||
    @ApiOperation(value = "获取开通区域列表")
 | 
			
		||||
    @GetMapping("{page}/{limit}")
 | 
			
		||||
    public Result index(
 | 
			
		||||
            @ApiParam(name = "page", value = "当前页码", required = true)
 | 
			
		||||
            @PathVariable Long page,
 | 
			
		||||
            @ApiParam(name = "limit", value = "每页记录数", required = true)
 | 
			
		||||
            @PathVariable Long limit,
 | 
			
		||||
            @ApiParam(name = "regionWareVo", value = "查询对象", required = false)
 | 
			
		||||
            RegionWareQueryVo regionWareQueryVo) {
 | 
			
		||||
    public Result index(@ApiParam(name = "page", value = "当前页码", required = true) @PathVariable Long page,
 | 
			
		||||
                        @ApiParam(name = "limit", value = "每页记录数", required = true) @PathVariable Long limit,
 | 
			
		||||
                        @ApiParam(name = "regionWareVo", value = "查询对象", required = false) RegionWareQueryVo regionWareQueryVo) {
 | 
			
		||||
        try {
 | 
			
		||||
            Page<RegionWare> pageParam = new Page<>(page, limit);
 | 
			
		||||
            IPage<RegionWare> pageModel = regionWareService.selectPage(pageParam, regionWareQueryVo);
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ package com.atguigu.ssyx.sys.mapper;
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.model.sys.Region;
 | 
			
		||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
			
		||||
import org.mapstruct.Mapper;
 | 
			
		||||
import org.springframework.stereotype.Repository;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
@@ -12,7 +12,7 @@ import org.mapstruct.Mapper;
 | 
			
		||||
 * @author atguigu
 | 
			
		||||
 * @since 2023-09-14
 | 
			
		||||
 */
 | 
			
		||||
@Mapper
 | 
			
		||||
@Repository
 | 
			
		||||
public interface RegionMapper extends BaseMapper<Region> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ package com.atguigu.ssyx.sys.mapper;
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.model.sys.RegionWare;
 | 
			
		||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
			
		||||
import org.mapstruct.Mapper;
 | 
			
		||||
import org.springframework.stereotype.Repository;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
@@ -12,7 +12,7 @@ import org.mapstruct.Mapper;
 | 
			
		||||
 * @author atguigu
 | 
			
		||||
 * @since 2023-09-14
 | 
			
		||||
 */
 | 
			
		||||
@Mapper
 | 
			
		||||
@Repository
 | 
			
		||||
public interface RegionWareMapper extends BaseMapper<RegionWare> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package com.atguigu.ssyx.sys.mapper;
 | 
			
		||||
 | 
			
		||||
import com.atguigu.ssyx.model.sys.Ware;
 | 
			
		||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
			
		||||
import org.mapstruct.Mapper;
 | 
			
		||||
import org.springframework.stereotype.Repository;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
@@ -13,7 +13,7 @@ import org.mapstruct.Mapper;
 | 
			
		||||
 * @author atguigu
 | 
			
		||||
 * @since 2023-09-14
 | 
			
		||||
 */
 | 
			
		||||
@Mapper
 | 
			
		||||
@Repository
 | 
			
		||||
public interface WareMapper extends BaseMapper<Ware> {
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -10,11 +10,10 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 | 
			
		||||
import com.baomidou.mybatisplus.core.metadata.IPage;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 | 
			
		||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.stereotype.Service;
 | 
			
		||||
import org.springframework.util.StringUtils;
 | 
			
		||||
 | 
			
		||||
import javax.annotation.Resource;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 城市仓库关联表 服务实现类
 | 
			
		||||
@@ -27,7 +26,7 @@ import javax.annotation.Resource;
 | 
			
		||||
public class RegionWareServiceImpl extends ServiceImpl<RegionWareMapper, RegionWare> implements RegionWareService {
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    @Resource
 | 
			
		||||
    @Autowired
 | 
			
		||||
    RegionWareMapper regionWareMapper;
 | 
			
		||||
 | 
			
		||||
    //开通区域列表
 | 
			
		||||
@@ -41,7 +40,8 @@ public class RegionWareServiceImpl extends ServiceImpl<RegionWareMapper, RegionW
 | 
			
		||||
                    .or()
 | 
			
		||||
                    .like(RegionWare::getWareName, keyword);
 | 
			
		||||
        }
 | 
			
		||||
        return baseMapper.selectPage(pageParam, wrapper);
 | 
			
		||||
        IPage<RegionWare> regionWarePage = baseMapper.selectPage(pageParam, wrapper);
 | 
			
		||||
        return regionWarePage;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //添加开通区域
 | 
			
		||||
 
 | 
			
		||||
@@ -16,3 +16,4 @@ spring:
 | 
			
		||||
  jackson:
 | 
			
		||||
    date-format: yyyy-MM-dd HH:mm:ss
 | 
			
		||||
    time-zone: GMT+8
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user