From 9f8f9d13c42ca8cdccbf351069082a5fdccef2e4 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Mon, 25 Mar 2024 17:30:51 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/main/java/org/springblade/modules/place/controller/PlaceController.java | 196 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 192 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/springblade/modules/place/controller/PlaceController.java b/src/main/java/org/springblade/modules/place/controller/PlaceController.java
index cd9d24f..dfa56e7 100644
--- a/src/main/java/org/springblade/modules/place/controller/PlaceController.java
+++ b/src/main/java/org/springblade/modules/place/controller/PlaceController.java
@@ -21,13 +21,17 @@
import io.swagger.annotations.ApiParam;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
+
+import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
-import org.springblade.core.secure.BladeUser;
+import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.place.excel.*;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.place.entity.PlaceEntity;
@@ -35,6 +39,9 @@
import org.springblade.modules.place.wrapper.PlaceWrapper;
import org.springblade.modules.place.service.IPlaceService;
import org.springblade.core.boot.ctrl.BladeController;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.List;
/**
* 场所表 控制器
@@ -65,7 +72,7 @@
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
- @ApiOperation(value = "分页", notes = "传入place")
+ @ApiOperation(value = "分页LIST", notes = "传入place")
public R<IPage<PlaceVO>> list(PlaceEntity place, Query query) {
IPage<PlaceEntity> pages = placeService.page(Condition.getPage(query), Condition.getQueryWrapper(place));
return R.data(PlaceWrapper.build().pageVO(pages));
@@ -76,9 +83,31 @@
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
- @ApiOperation(value = "分页", notes = "传入place")
+ @ApiOperation(value = "分页page", notes = "传入place")
public R<IPage<PlaceVO>> page(PlaceVO place, Query query) {
IPage<PlaceVO> pages = placeService.selectPlacePage(Condition.getPage(query), place);
+ return R.data(pages);
+ }
+
+ /**
+ * 九小场所档案
+ */
+ @GetMapping("/ninePage")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "九小场所档案", notes = "传入place")
+ public R<IPage<PlaceVO>> ninePage(PlaceVO place, Query query) {
+ IPage<PlaceVO> pages = placeService.selectNinePlacePage(Condition.getPage(query), place);
+ return R.data(pages);
+ }
+
+ /**
+ * 企业商超列表查询
+ */
+ @GetMapping("/mallPage")
+ @ApiOperationSupport(order = 3)
+ @ApiOperation(value = "企业商超列表查询", notes = "传入place")
+ public R<IPage<PlaceVO>> mallPage(PlaceVO place, Query query) {
+ IPage<PlaceVO> pages = placeService.selectMallPage(Condition.getPage(query), place);
return R.data(pages);
}
@@ -93,6 +122,29 @@
}
/**
+ * 自定义新增
+ * @param placeVO
+ * @return
+ */
+ @PostMapping("/add")
+ @ApiOperation(value = "自定义新增", notes = "传入place")
+ public R add(@RequestBody PlaceVO placeVO){
+ return R.status(placeService.addOrUpdate(placeVO));
+ }
+
+
+ /**
+ * 自定义新增/修改
+ * @param placeVO
+ * @return
+ */
+ @PostMapping("/addOrUpdate")
+ @ApiOperation(value = "自定义新增/修改", notes = "传入place")
+ public R addOrUpdate(@RequestBody PlaceVO placeVO){
+ return R.status(placeService.addOrUpdate(placeVO));
+ }
+
+ /**
* 场所表 修改
*/
@PostMapping("/update")
@@ -100,6 +152,18 @@
@ApiOperation(value = "修改", notes = "传入place")
public R update(@Valid @RequestBody PlaceEntity place) {
return R.status(placeService.updateById(place));
+ }
+
+
+ /**
+ * 自定义修改
+ * @param placeVO
+ * @return
+ */
+ @PostMapping("/updatePlace")
+ @ApiOperation(value = "自定义修改", notes = "传入place")
+ public R updatePlace(@RequestBody PlaceVO placeVO){
+ return R.status(placeService.updatePlace(placeVO));
}
/**
@@ -119,8 +183,132 @@
@ApiOperationSupport(order = 7)
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- return R.status(placeService.removeByIds(Func.toLongList(ids)));
+ List<Long> longs = Func.toLongList(ids);
+ // 返回
+ return R.status(placeService.removePlace(longs));
+ }
+
+ /**
+ * 历史场所挂接处理-临时
+ * @param place
+ * @return
+ */
+ @GetMapping("/historyPlaceHandle")
+ public R historyPlaceHandle(PlaceVO place) {
+ return R.data(placeService.historyPlaceHandle(place));
+ }
+
+ /**
+ * 历史场所标签挂接处理-场所标签-临时
+ * @param place
+ * @return
+ */
+ @GetMapping("/historyPlaceLabelHandle")
+ public R historyPlaceLabelHandle(PlaceVO place) {
+ return R.data(placeService.historyPlaceLabelHandle(place));
+ }
+
+ /**
+ * 历史场所详情数据处理
+ * @param place
+ * @return
+ */
+ @GetMapping("/historyPlaceExtHandle")
+ public R historyPlaceExtHandle(PlaceVO place) {
+ return R.data(placeService.historyPlaceExtHandle(place));
}
+ /**
+ * 场所表 自定义详情查询
+ * @param place
+ * @return
+ */
+ @GetMapping("/getDetail")
+ @ApiOperation(value = "场所表 自定义详情查询", notes = "传入ids")
+ public R<PlaceVO> getDetail(PlaceVO place) {
+ return R.data(placeService.getDetail(place));
+ }
+
+
+ /**
+ * 导入场所数据
+ */
+ @PostMapping("/import-place")
+ public R importPlace(MultipartFile file, Integer isCovered) {
+ PlaceImporter placeImporter = new PlaceImporter(placeService, isCovered == 1);
+ ExcelUtil.save(file, placeImporter, PlaceExcel.class);
+ return R.success("操作成功");
+ }
+
+ /**
+ * 导入场所(商超)数据
+ */
+ @PostMapping("/import-placeAndRel")
+ public R importPlaceAndRel(MultipartFile file, Integer isCovered) {
+ PlaceAndRelImporter placeImporter = new PlaceAndRelImporter(placeService, isCovered == 1);
+ ExcelUtil.save(file, placeImporter, PlaceAndRelExcel.class);
+ return R.success("操作成功");
+ }
+
+ /**
+ * 商超数据处理
+ * @return
+ */
+ @GetMapping("/placeAndRelHandle")
+ public R placeAndRelHandle() {
+ return R.data(placeService.placeAndRelHandle());
+ }
+
+ /**
+ * 场所数据处理-用户信息(场所负责人信息写入到场所表)
+ */
+ @GetMapping("/placeUserHandle")
+ public R placeUserHandle() {
+ return R.data(placeService.placeUserHandle());
+ }
+
+ /**
+ * 场所标签数据处理
+ */
+ @GetMapping("/placeLabelHandle")
+ public R placeLabelHandle() {
+ return R.data(placeService.placeLabelHandle());
+ }
+
+ /**
+ * 导出九小统计
+ */
+ @GetMapping("exportNineType")
+ @ApiOperationSupport(order = 13)
+ @ApiOperation(value = "导出九小统计", notes = "传入place")
+ public void exportNineType(PlaceVO place, HttpServletResponse response) {
+ List<NinePlaceExcel> list = placeService.export(place);
+ ExcelUtil.export(response, "档案管理" + DateUtil.time(), "场所数据表", list, NinePlaceExcel.class);
+ }
+
+
+ /**
+ * 场所警务网格处理
+ */
+ @GetMapping("/placeJwGridCodeHandle")
+ public R placeJwGridCodeHandle() {
+ return R.data(placeService.placeJwGridCodeHandle());
+ }
+
+ /**
+ * 场所综治网格处理
+ */
+ @GetMapping("/placeGridCodeHandle")
+ public R placeGridCodeHandle() {
+ return R.data(placeService.placeGridCodeHandle());
+ }
+
+ /**
+ * 场所二维码绑定处理
+ */
+ @GetMapping("/placeDoorBindHandle")
+ public R placeDoorBindHandle() {
+ return R.data(placeService.placeDoorBindHandle());
+ }
}
--
Gitblit v1.9.3