kongdeqiang
2024-04-22 7bc78d8f70a4d11e46f8bd640228804a3dd0dc68
src/main/java/com/boying/controller/StreetController.java
@@ -11,7 +11,10 @@
import com.boying.service.StreetReRoadService;
import com.boying.service.StreetService;
import com.boying.util.LngLatUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -26,6 +29,7 @@
@RestController
@RequestMapping("ffzf/street")
@RequiredArgsConstructor
@Tag(description = "ffzf/street" , name = "街道统计" )
public class StreetController {
@@ -34,6 +38,7 @@
    private final StreetLogoService streetLogoService;
    @PostMapping("/findPage")
    @Operation(summary = "分页查询" , description = "分页查询" )
    public Object findPage(Page page, Street street) {
        QueryWrapper<Street> wrapper = new QueryWrapper<>();
        wrapper.lambda()
@@ -42,6 +47,7 @@
    }
    @PostMapping("/save")
    @Operation(summary = "新增街道" , description = "新增街道" )
    public Object save(Street street) {
        QueryWrapper<Street> wrapper = new QueryWrapper<>();
        wrapper.lambda()
@@ -62,6 +68,7 @@
    }
    @PostMapping("/save2")
    @Operation(summary = "新增路" , description = "新增路" )
    public Object save2(StreetReRoad streetReRoad) {
        streetReRoadService.saveOrUpdate(streetReRoad);
        return R.ok();
@@ -69,18 +76,21 @@
    @PostMapping("/delete")
    @Operation(summary = "删除街" , description = "删除街" )
    public Object delete(Long id) {
        streetService.removeById(id);
        return R.ok();
    }
    @PostMapping("/delete2")
    @Operation(summary = "删除路" , description = "删除路" )
    public Object delete2(Long id) {
        streetReRoadService.removeById(id);
        return R.ok();
    }
    @PostMapping("/findById")
    @GetMapping("/findById")
    @Operation(summary = "根据id查询(APP)" , description = "根据id查询(APP)" )
    public Object findById(Long id,int type) {
        if(type==0){
            QueryWrapper<StreetReRoad> roadQueryWrapper = new QueryWrapper<>();
@@ -108,7 +118,8 @@
        }
    }
    @PostMapping("/findList")
    @GetMapping("/findList")
    @Operation(summary = "查询所有街道和路" , description = "查询所有街道和路" )
    public Object findAll() {
        Map<String,Object> map = new HashMap<>();
        QueryWrapper<Street> wrapper = new QueryWrapper<>();
@@ -119,10 +130,18 @@
        wrapper.lambda()
                .eq(Street::getType,1);
        map.put("list2",streetService.list(wrapper));
        return R.ok(map);
    }
    @GetMapping("/findList2")
    @Operation(summary = "查询所有街道" , description = "查询所有街道" )
    public Object findAll2() {
        return R.ok(streetService.list());
    }
    @PostMapping("findLogo")
    @Operation(summary = "查询所有街道违章" , description = "查询所有街道违章" )
    public Object findLogo(String lng ,String lat) {
        List<StreetLogo> all = streetLogoService.list();
        List<StreetLogo> all2 = new ArrayList<>();