|
@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
import static com.xy.utils.Beans.copy;
|
|
@@ -101,4 +102,18 @@ public class SysRegionServiceImpl extends ServiceImpl<SysRegionMapper, SysRegion
|
|
|
updateById(sysRegion);
|
|
|
return R.ok();
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ @PostMapping("createLocalJson")
|
|
|
+ @ApiOperation("生成json")
|
|
|
+ public R createLocalJson() {
|
|
|
+ LambdaQueryWrapper<SysRegion> lqw = new LambdaQueryWrapper<>();
|
|
|
+ lqw.select(SysRegion::getId, SysRegion::getPid, SysRegion::getName);
|
|
|
+ List<SysRegion> list = list(lqw);
|
|
|
+ List<SysRegionDto.LocalJson> localJsonList = new ArrayList<>();
|
|
|
+ list.forEach(item -> {
|
|
|
+ localJsonList.add(new SysRegionDto.LocalJson().setName(item.getName()).setValue(item.getId().toString()).setParent(item.getPid().toString()));
|
|
|
+ });
|
|
|
+ return R.ok(localJsonList);
|
|
|
+ }
|
|
|
}
|