|
@@ -32,11 +32,11 @@ import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
import org.springblade.core.tool.constant.BladeConstant;
|
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
import org.springblade.core.tool.utils.DateUtil;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
-import org.springblade.modules.ycwh.entity.FamousLocationEntity;
|
|
|
|
|
-import org.springblade.modules.ycwh.excel.FamousLocationExcel;
|
|
|
|
|
-import org.springblade.modules.ycwh.service.IFamousLocationService;
|
|
|
|
|
-import org.springblade.modules.ycwh.vo.FamousLocationVO;
|
|
|
|
|
-import org.springblade.modules.ycwh.wrapper.FamousLocationWrapper;
|
|
|
|
|
|
|
+import org.springblade.modules.ycwh.entity.FamousSnacksEntity;
|
|
|
|
|
+import org.springblade.modules.ycwh.excel.FamousSnacksExcel;
|
|
|
|
|
+import org.springblade.modules.ycwh.service.IFamousSnacksService;
|
|
|
|
|
+import org.springblade.modules.ycwh.vo.FamousSnacksVO;
|
|
|
|
|
+import org.springblade.modules.ycwh.wrapper.FamousSnacksWrapper;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
|
@@ -53,31 +53,32 @@ import java.util.Map;
|
|
|
*/
|
|
*/
|
|
|
@RestController
|
|
@RestController
|
|
|
@AllArgsConstructor
|
|
@AllArgsConstructor
|
|
|
-@RequestMapping("famous_location")
|
|
|
|
|
|
|
+@RequestMapping("famous_snacks")
|
|
|
@Api(value = "名点", tags = "名点接口")
|
|
@Api(value = "名点", tags = "名点接口")
|
|
|
-public class FamousLocationController extends BladeController {
|
|
|
|
|
|
|
+public class FamousSnacksController extends BladeController {
|
|
|
|
|
|
|
|
- private final IFamousLocationService famousLocationService;
|
|
|
|
|
|
|
+ private final IFamousSnacksService famousSnacksService;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 名点 详情
|
|
* 名点 详情
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/detail")
|
|
@GetMapping("/detail")
|
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
|
- @ApiOperation(value = "详情", notes = "传入famousLocation")
|
|
|
|
|
- public R<FamousLocationVO> detail(FamousLocationEntity famousLocation) {
|
|
|
|
|
- FamousLocationEntity detail = famousLocationService.getOne(Condition.getQueryWrapper(famousLocation));
|
|
|
|
|
- return R.data(FamousLocationWrapper.build().entityVO(detail));
|
|
|
|
|
|
|
+ @ApiOperation(value = "详情", notes = "传入famousSnacks")
|
|
|
|
|
+ public R<FamousSnacksVO> detail(FamousSnacksEntity famousSnacks) {
|
|
|
|
|
+ FamousSnacksEntity detail = famousSnacksService.getOne(Condition.getQueryWrapper(famousSnacks));
|
|
|
|
|
+ return R.data(FamousSnacksWrapper.build().entityVO(detail));
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 名点 分页
|
|
* 名点 分页
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/list")
|
|
@GetMapping("/list")
|
|
|
@ApiOperationSupport(order = 2)
|
|
@ApiOperationSupport(order = 2)
|
|
|
- @ApiOperation(value = "分页", notes = "传入famousLocation")
|
|
|
|
|
- public R<IPage<FamousLocationVO>> list(@ApiIgnore @RequestParam Map<String, Object> famousLocation, Query query) {
|
|
|
|
|
- IPage<FamousLocationEntity> pages = famousLocationService.page(Condition.getPage(query), Condition.getQueryWrapper(famousLocation, FamousLocationEntity.class));
|
|
|
|
|
- return R.data(FamousLocationWrapper.build().pageVO(pages));
|
|
|
|
|
|
|
+ @ApiOperation(value = "分页", notes = "传入famousSnacks")
|
|
|
|
|
+ public R<IPage<FamousSnacksVO>> list(@ApiIgnore @RequestParam Map<String, Object> famousSnacks, Query query) {
|
|
|
|
|
+ IPage<FamousSnacksEntity> pages = famousSnacksService.page(Condition.getPage(query), Condition.getQueryWrapper(famousSnacks, FamousSnacksEntity.class));
|
|
|
|
|
+ return R.data(FamousSnacksWrapper.build().pageVO(pages));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -85,9 +86,9 @@ public class FamousLocationController extends BladeController {
|
|
|
*/
|
|
*/
|
|
|
@GetMapping("/page")
|
|
@GetMapping("/page")
|
|
|
@ApiOperationSupport(order = 3)
|
|
@ApiOperationSupport(order = 3)
|
|
|
- @ApiOperation(value = "分页", notes = "传入famousLocation")
|
|
|
|
|
- public R<IPage<FamousLocationVO>> page(FamousLocationVO famousLocation, Query query) {
|
|
|
|
|
- IPage<FamousLocationVO> pages = famousLocationService.selectFamousLocationPage(Condition.getPage(query), famousLocation);
|
|
|
|
|
|
|
+ @ApiOperation(value = "分页", notes = "传入famousSnacks")
|
|
|
|
|
+ public R<IPage<FamousSnacksVO>> page(FamousSnacksVO famousSnacks, Query query) {
|
|
|
|
|
+ IPage<FamousSnacksVO> pages = famousSnacksService.selectFamousSnacksPage(Condition.getPage(query), famousSnacks);
|
|
|
return R.data(pages);
|
|
return R.data(pages);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -96,9 +97,9 @@ public class FamousLocationController extends BladeController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/save")
|
|
@PostMapping("/save")
|
|
|
@ApiOperationSupport(order = 4)
|
|
@ApiOperationSupport(order = 4)
|
|
|
- @ApiOperation(value = "新增", notes = "传入famousLocation")
|
|
|
|
|
- public R save(@Valid @RequestBody FamousLocationEntity famousLocation) {
|
|
|
|
|
- return R.status(famousLocationService.save(famousLocation));
|
|
|
|
|
|
|
+ @ApiOperation(value = "新增", notes = "传入famousSnacks")
|
|
|
|
|
+ public R save(@Valid @RequestBody FamousSnacksEntity famousSnacks) {
|
|
|
|
|
+ return R.status(famousSnacksService.save(famousSnacks));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -106,9 +107,9 @@ public class FamousLocationController extends BladeController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/update")
|
|
@PostMapping("/update")
|
|
|
@ApiOperationSupport(order = 5)
|
|
@ApiOperationSupport(order = 5)
|
|
|
- @ApiOperation(value = "修改", notes = "传入famousLocation")
|
|
|
|
|
- public R update(@Valid @RequestBody FamousLocationEntity famousLocation) {
|
|
|
|
|
- return R.status(famousLocationService.updateById(famousLocation));
|
|
|
|
|
|
|
+ @ApiOperation(value = "修改", notes = "传入famousSnacks")
|
|
|
|
|
+ public R update(@Valid @RequestBody FamousSnacksEntity famousSnacks) {
|
|
|
|
|
+ return R.status(famousSnacksService.updateById(famousSnacks));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -116,9 +117,9 @@ public class FamousLocationController extends BladeController {
|
|
|
*/
|
|
*/
|
|
|
@PostMapping("/submit")
|
|
@PostMapping("/submit")
|
|
|
@ApiOperationSupport(order = 6)
|
|
@ApiOperationSupport(order = 6)
|
|
|
- @ApiOperation(value = "新增或修改", notes = "传入famousLocation")
|
|
|
|
|
- public R submit(@Valid @RequestBody FamousLocationEntity famousLocation) {
|
|
|
|
|
- return R.status(famousLocationService.saveOrUpdate(famousLocation));
|
|
|
|
|
|
|
+ @ApiOperation(value = "新增或修改", notes = "传入famousSnacks")
|
|
|
|
|
+ public R submit(@Valid @RequestBody FamousSnacksEntity famousSnacks) {
|
|
|
|
|
+ return R.status(famousSnacksService.saveOrUpdate(famousSnacks));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -128,24 +129,24 @@ public class FamousLocationController extends BladeController {
|
|
|
@ApiOperationSupport(order = 7)
|
|
@ApiOperationSupport(order = 7)
|
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
@ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
- return R.status(famousLocationService.deleteLogic(Func.toLongList(ids)));
|
|
|
|
|
|
|
+ return R.status(famousSnacksService.deleteLogic(Func.toLongList(ids)));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 导出数据
|
|
* 导出数据
|
|
|
*/
|
|
*/
|
|
|
- @GetMapping("/export-famousLocation")
|
|
|
|
|
|
|
+ @GetMapping("/export-famousSnacks")
|
|
|
@ApiOperationSupport(order = 9)
|
|
@ApiOperationSupport(order = 9)
|
|
|
- @ApiOperation(value = "导出数据", notes = "传入famousLocation")
|
|
|
|
|
- public void exportFamousLocation(@ApiIgnore @RequestParam Map<String, Object> famousLocation, BladeUser bladeUser, HttpServletResponse response) {
|
|
|
|
|
- QueryWrapper<FamousLocationEntity> queryWrapper = Condition.getQueryWrapper(famousLocation, FamousLocationEntity.class);
|
|
|
|
|
|
|
+ @ApiOperation(value = "导出数据", notes = "传入famousSnacks")
|
|
|
|
|
+ public void exportFamousSnacks(@ApiIgnore @RequestParam Map<String, Object> famousSnacks, BladeUser bladeUser, HttpServletResponse response) {
|
|
|
|
|
+ QueryWrapper<FamousSnacksEntity> queryWrapper = Condition.getQueryWrapper(famousSnacks, FamousSnacksEntity.class);
|
|
|
//if (!AuthUtil.isAdministrator()) {
|
|
//if (!AuthUtil.isAdministrator()) {
|
|
|
- // queryWrapper.lambda().eq(FamousLocation::getTenantId, bladeUser.getTenantId());
|
|
|
|
|
|
|
+ // queryWrapper.lambda().eq(FamousSnacks::getTenantId, bladeUser.getTenantId());
|
|
|
//}
|
|
//}
|
|
|
- queryWrapper.lambda().eq(FamousLocationEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
|
|
|
|
- List<FamousLocationExcel> list = famousLocationService.exportFamousLocation(queryWrapper);
|
|
|
|
|
- ExcelUtil.export(response, "名点数据" + DateUtil.time(), "名点数据表", list, FamousLocationExcel.class);
|
|
|
|
|
|
|
+ queryWrapper.lambda().eq(FamousSnacksEntity::getIsDeleted, BladeConstant.DB_NOT_DELETED);
|
|
|
|
|
+ List<FamousSnacksExcel> list = famousSnacksService.exportFamousSnacks(queryWrapper);
|
|
|
|
|
+ ExcelUtil.export(response, "名点数据" + DateUtil.time(), "名点数据表", list, FamousSnacksExcel.class);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|