Prechádzať zdrojové kódy

feat(app): 实现场所管理功能

- 新增场所保存、编辑、删除等功能
- 实现场所价格规则的保存、编辑、删除等功能
- 添加场所分页查询接口
- 优化场所相关代码结构和逻辑
lix 2 týždňov pred
rodič
commit
2f725bd73e

+ 4 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppGameController.java

@@ -78,7 +78,7 @@ public class AppGameController extends JeecgController<AppGame, IAppGameService>
 	 */
 	@AutoLog(value = "赛事表-添加")
 	@Operation(summary="赛事表-添加")
-	@RequiresPermissions("org.jeecg.modules.app:nm_game:add")
+//	@RequiresPermissions("org.jeecg.modules.app:nm_game:add")
 	@PostMapping(value = "/add")
 	public Result<String> add(@RequestBody AppGameDTO gameDTO) {
 		return appGameService.saveWitchPriceRules(gameDTO)? Result.OK("操作成功!"): Result.error("操作失败!");
@@ -92,7 +92,7 @@ public class AppGameController extends JeecgController<AppGame, IAppGameService>
 	 */
 	@AutoLog(value = "赛事表-编辑")
 	@Operation(summary="赛事表-编辑")
-	@RequiresPermissions("org.jeecg.modules.app:nm_game:edit")
+//	@RequiresPermissions("org.jeecg.modules.app:nm_game:edit")
 	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
 	public Result<String> edit(@RequestBody AppGameDTO gameDTO) {
 		return appGameService.editWitchPriceRules(gameDTO)? Result.OK("操作成功!"): Result.error("操作失败!");
@@ -106,7 +106,7 @@ public class AppGameController extends JeecgController<AppGame, IAppGameService>
 	 */
 	@AutoLog(value = "赛事表-通过id删除")
 	@Operation(summary="赛事表-通过id删除")
-	@RequiresPermissions("org.jeecg.modules.app:nm_game:delete")
+//	@RequiresPermissions("org.jeecg.modules.app:nm_game:delete")
 	@DeleteMapping(value = "/delete")
 	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
 		return appGameService.deleteWitchPriceRulesById(id)? Result.OK("操作成功!"): Result.error("操作失败!");
@@ -146,7 +146,7 @@ public class AppGameController extends JeecgController<AppGame, IAppGameService>
     * @param request
     * @param appGame
     */
-    @RequiresPermissions("org.jeecg.modules.app:nm_game:exportXls")
+//    @RequiresPermissions("org.jeecg.modules.app:nm_game:exportXls")
     @RequestMapping(value = "/exportXls")
     public ModelAndView exportXls(HttpServletRequest request, AppGame appGame) {
         return super.exportXls(request, appGame, AppGame.class, "赛事表");

+ 54 - 67
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/controller/AppSitePlaceController.java

@@ -20,6 +20,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
+import org.jeecg.modules.system.app.dto.AppSitePlaceCuDTO;
+import org.jeecg.modules.system.app.dto.AppSitePlaceDTO;
+import org.jeecg.modules.system.app.dto.AppSitePlacePageDTO;
 import org.jeecg.modules.system.app.entity.AppSitePlace;
 import org.jeecg.modules.system.app.service.IAppSitePlaceService;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
@@ -46,7 +49,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
  */
 @Tag(name="商户场所表")
 @RestController
-@RequestMapping("/org/jeecg/modules/system/app/appSitePlace")
+@RequestMapping("/app/appSitePlace")
 @Slf4j
 public class AppSitePlaceController extends JeecgController<AppSitePlace, IAppSitePlaceService> {
 	@Autowired
@@ -56,24 +59,13 @@ public class AppSitePlaceController extends JeecgController<AppSitePlace, IAppSi
 	 * 分页列表查询
 	 *
 	 * @param appSitePlace
-	 * @param pageNo
-	 * @param pageSize
-	 * @param req
 	 * @return
 	 */
 	//@AutoLog(value = "商户场所表-分页列表查询")
 	@Operation(summary="商户场所表-分页列表查询")
 	@GetMapping(value = "/list")
-	public Result<IPage<AppSitePlace>> queryPageList(AppSitePlace appSitePlace,
-								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
-								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
-								   HttpServletRequest req) {
-
-
-        QueryWrapper<AppSitePlace> queryWrapper = QueryGenerator.initQueryWrapper(appSitePlace, req.getParameterMap());
-		Page<AppSitePlace> page = new Page<AppSitePlace>(pageNo, pageSize);
-		IPage<AppSitePlace> pageList = appSitePlaceService.page(page, queryWrapper);
-		return Result.OK(pageList);
+	public Result<IPage<AppSitePlaceCuDTO>> queryPageList(AppSitePlacePageDTO appSitePlace) {
+		return Result.OK(appSitePlaceService.queryWitchPriceRulesPage(appSitePlace));
 	}
 	
 	/**
@@ -84,11 +76,10 @@ public class AppSitePlaceController extends JeecgController<AppSitePlace, IAppSi
 	 */
 	@AutoLog(value = "商户场所表-添加")
 	@Operation(summary="商户场所表-添加")
-	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:add")
+//	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:add")
 	@PostMapping(value = "/add")
-	public Result<String> add(@RequestBody AppSitePlace appSitePlace) {
-		appSitePlaceService.save(appSitePlace);
-
+	public Result<String> add(@RequestBody AppSitePlaceDTO appSitePlace) {
+		appSitePlaceService.saveWitchPriceRules(appSitePlace);
 		return Result.OK("添加成功!");
 	}
 	
@@ -100,10 +91,10 @@ public class AppSitePlaceController extends JeecgController<AppSitePlace, IAppSi
 	 */
 	@AutoLog(value = "商户场所表-编辑")
 	@Operation(summary="商户场所表-编辑")
-	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:edit")
+//	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:edit")
 	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
-	public Result<String> edit(@RequestBody AppSitePlace appSitePlace) {
-		appSitePlaceService.updateById(appSitePlace);
+	public Result<String> edit(@RequestBody AppSitePlaceDTO appSitePlace) {
+		appSitePlaceService.editWitchPriceRules(appSitePlace);
 		return Result.OK("编辑成功!");
 	}
 	
@@ -115,28 +106,28 @@ public class AppSitePlaceController extends JeecgController<AppSitePlace, IAppSi
 	 */
 	@AutoLog(value = "商户场所表-通过id删除")
 	@Operation(summary="商户场所表-通过id删除")
-	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:delete")
+//	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:delete")
 	@DeleteMapping(value = "/delete")
 	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
 		appSitePlaceService.removeById(id);
 		return Result.OK("删除成功!");
 	}
 	
-	/**
-	 *  批量删除
-	 *
-	 * @param ids
-	 * @return
-	 */
-	@AutoLog(value = "商户场所表-批量删除")
-	@Operation(summary="商户场所表-批量删除")
-	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:deleteBatch")
-	@DeleteMapping(value = "/deleteBatch")
-	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
-		this.appSitePlaceService.removeByIds(Arrays.asList(ids.split(",")));
-		return Result.OK("批量删除成功!");
-	}
-	
+//	/**
+//	 *  批量删除
+//	 *
+//	 * @param ids
+//	 * @return
+//	 */
+//	@AutoLog(value = "商户场所表-批量删除")
+//	@Operation(summary="商户场所表-批量删除")
+//	@RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:deleteBatch")
+//	@DeleteMapping(value = "/deleteBatch")
+//	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+//		this.appSitePlaceService.removeByIds(Arrays.asList(ids.split(",")));
+//		return Result.OK("批量删除成功!");
+//	}
+//
 	/**
 	 * 通过id查询
 	 *
@@ -146,37 +137,33 @@ public class AppSitePlaceController extends JeecgController<AppSitePlace, IAppSi
 	//@AutoLog(value = "商户场所表-通过id查询")
 	@Operation(summary="商户场所表-通过id查询")
 	@GetMapping(value = "/queryById")
-	public Result<AppSitePlace> queryById(@RequestParam(name="id",required=true) String id) {
-		AppSitePlace appSitePlace = appSitePlaceService.getById(id);
-		if(appSitePlace==null) {
-			return Result.error("未找到对应数据");
-		}
-		return Result.OK(appSitePlace);
+	public Result<AppSitePlaceDTO> queryById(@RequestParam(name="id",required=true) String id) {
+		return Result.OK(appSitePlaceService.queryWitchPriceRulesById( id));
 	}
 
-    /**
-    * 导出excel
-    *
-    * @param request
-    * @param appSitePlace
-    */
-    @RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:exportXls")
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, AppSitePlace appSitePlace) {
-        return super.exportXls(request, appSitePlace, AppSitePlace.class, "商户场所表");
-    }
-
-    /**
-      * 通过excel导入数据
-    *
-    * @param request
-    * @param response
-    * @return
-    */
-    @RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:importExcel")
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        return super.importExcel(request, response, AppSitePlace.class);
-    }
+//    /**
+//    * 导出excel
+//    *
+//    * @param request
+//    * @param appSitePlace
+//    */
+//    @RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:exportXls")
+//    @RequestMapping(value = "/exportXls")
+//    public ModelAndView exportXls(HttpServletRequest request, AppSitePlace appSitePlace) {
+//        return super.exportXls(request, appSitePlace, AppSitePlace.class, "商户场所表");
+//    }
+//
+//    /**
+//      * 通过excel导入数据
+//    *
+//    * @param request
+//    * @param response
+//    * @return
+//    */
+//    @RequiresPermissions("org.jeecg.modules.system.app:nm_site_place:importExcel")
+//    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+//    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+//        return super.importExcel(request, response, AppSitePlace.class);
+//    }
 
 }

+ 10 - 4
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/IAppSitePlaceService.java

@@ -21,24 +21,30 @@ public interface IAppSitePlaceService extends IService<AppSitePlace> {
      */
     Boolean saveWitchPriceRules(AppSitePlaceDTO placeDTO);
     /**
-     * 商户修改
+     * 场所修改
      * @param placeDTO
      * @return
      */
     Boolean editWitchPriceRules(AppSitePlaceDTO placeDTO);
     /**
-     * 通过id查询商户
+     * 通过id查询场所
      * @param id
      * @return
      */
-    AppSitePlaceCuDTO queryWitchPriceRulesById(String id);
+    AppSitePlaceDTO queryWitchPriceRulesById(String id);
     /**
-     * 删除商户
+     * 删除场所
      * @param id
      * @return
      */
     Boolean deleteWitchPriceRulesById(String id);
 
+    /**
+     * 分页列表
+     * @param dto
+     * @return
+     */
+
     IPage<AppSitePlaceCuDTO> queryWitchPriceRulesPage(AppSitePlacePageDTO dto);
 
 }

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoureseServiceImpl.java

@@ -38,7 +38,7 @@ import static org.jeecg.common.constant.CommonConstant.SC_INTERNAL_SERVER_ERROR_
 @Service
 public class AppCoureseServiceImpl extends ServiceImpl<AppCoursesMapper, AppCourses> implements IAppCoureseService {
     @Resource
-    AppCoursesPriceRulesMapper priceRulesMapper;
+    private AppCoursesPriceRulesMapper priceRulesMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)

+ 1 - 2
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppCoursesPriceRulesServiceImpl.java

@@ -30,7 +30,7 @@ import java.util.stream.Collectors;
 public class AppCoursesPriceRulesServiceImpl extends ServiceImpl<AppCoursesPriceRulesMapper, AppCoursesPriceRules> implements IAppCoursesPriceRulesService {
 
     @Resource
-    AppCoursesMapper appCoursesMapper;
+    private AppCoursesMapper appCoursesMapper;
 
     @Override
     public List<AppCoursesRuleDTO> queryCoursesPriceRulesList(String courseId) {
@@ -82,7 +82,6 @@ public class AppCoursesPriceRulesServiceImpl extends ServiceImpl<AppCoursesPrice
                 .map(dto -> {
                     AppCoursesPriceRules appCoursesPriceRules = new AppCoursesPriceRules();
                     BeanUtils.copyProperties(dto, appCoursesPriceRules);
-                    appCoursesPriceRules.setCoursesId(appCourses.getId());
                     return appCoursesPriceRules;
                 })
                 .collect(Collectors.toList());

+ 1 - 1
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppGameServiceImpl.java

@@ -39,7 +39,7 @@ public class AppGameServiceImpl extends ServiceImpl<AppGameMapper, AppGame> impl
     @Resource
     private AppGamePriceRulesMapper rulesMapper;
     @Resource
-    AppGameScheduleMapper scheduleMapper;
+    private AppGameScheduleMapper scheduleMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)

+ 140 - 30
national-motion-module-system/national-motion-system-biz/src/main/java/org/jeecg/modules/system/app/service/impl/AppSitePlaceServiceImpl.java

@@ -1,6 +1,10 @@
 package org.jeecg.modules.system.app.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.shiro.SecurityUtils;
 import org.jeecg.common.exception.JeecgBootException;
 import org.jeecg.common.system.vo.LoginUser;
@@ -22,72 +26,178 @@ import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
 import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
 
 import static org.jeecg.common.constant.CommonConstant.SC_INTERNAL_SERVER_ERROR_500;
 
 /**
  * @Description: 商户场所表
  * @Author: jeecg-boot
- * @Date:   2025-07-09
+ * @Date: 2025-07-09
  * @Version: V1.0
  */
 @Service
 public class AppSitePlaceServiceImpl extends ServiceImpl<AppSitePlaceMapper, AppSitePlace> implements IAppSitePlaceService {
     @Resource
-    AppSitePriceRulesMapper appSitePriceRulesMapper;
+    private AppSitePriceRulesMapper appSitePriceRulesMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
     public Boolean saveWitchPriceRules(AppSitePlaceDTO placeDTO) {
-//        AppSitePlaceCuDTO appSitePlaceCuDTO = placeDTO.getAppSitePlaceCuDTO();
-//        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
-//        if (null == appSitePlaceCuDTO.getSiteId()) throw new JeecgBootException("商户补充信息id不能为空", SC_INTERNAL_SERVER_ERROR_500);
-//        AppSitePlace appSitePlace = new AppSitePlace();
-//        BeanUtils.copyProperties(appSitePlaceCuDTO, appSitePlace);
-//        appSitePlace.setOrgCode(sysUser.getOrgCode());
-//        appSitePlace.setTenantId(sysUser.getOrgId());
-//        appSitePlace.setSiteId(appSitePlaceCuDTO.getSiteId());
-//        int insert = baseMapper.insert(appSitePlace);
-//        if (insert<1) {
-//            throw new JeecgBootException("商户场所保存失败");
-//        }
-//        placeDTO.getSiteRuleDTOS().forEach(rule -> {
-//            AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
-//            BeanUtils.copyProperties(rule, appSitePriceRules);
-//            appSitePriceRules.setSitePlaceId(appSitePlace.getId());
-//            appSitePriceRules.setOrgCode(appSitePlace.getOrgCode());
-//            appSitePriceRules.setTenantId(appSitePlace.getTenantId());
-//            int savePriceResult = baseMapper.insert(appSitePriceRules);
-//        });
+        AppSitePlaceCuDTO appSitePlaceCuDTO = placeDTO.getAppSitePlaceCuDTO();
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (null == appSitePlaceCuDTO.getSiteId())
+            throw new JeecgBootException("商户补充信息id不能为空", SC_INTERNAL_SERVER_ERROR_500);
+        AppSitePlace appSitePlace = new AppSitePlace();
+        BeanUtils.copyProperties(appSitePlaceCuDTO, appSitePlace);
+        appSitePlace.setOrgCode(sysUser.getOrgCode());
+        appSitePlace.setTenantId(sysUser.getOrgId());
+        appSitePlace.setSiteId(appSitePlaceCuDTO.getSiteId());
+        int insert = baseMapper.insert(appSitePlace);
+        if (insert < 1) {
+            throw new JeecgBootException("商户场所保存失败");
+        }
+        placeDTO.getSiteRuleDTOS().forEach(rule -> {
+            AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
+            BeanUtils.copyProperties(rule, appSitePriceRules);
+            appSitePriceRules.setSitePlaceId(appSitePlace.getId());
+            appSitePriceRules.setOrgCode(appSitePlace.getOrgCode());
+            appSitePriceRules.setTenantId(appSitePlace.getTenantId());
+            int savePriceResult = appSitePriceRulesMapper.insert(appSitePriceRules);
+            if (savePriceResult < 1) {
+                throw new JeecgBootException("场所价格规则保存失败", SC_INTERNAL_SERVER_ERROR_500);
+            }
+        });
 
-        return null;
+        return Boolean.TRUE;
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean editWitchPriceRules(AppSitePlaceDTO placeDTO) {
-        return null;
+        AppSitePlaceCuDTO appSitePlaceCuDTO = placeDTO.getAppSitePlaceCuDTO();
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        if (null == appSitePlaceCuDTO.getSiteId())
+            throw new JeecgBootException("商户补充信息id不能为空", SC_INTERNAL_SERVER_ERROR_500);
+        AppSitePlace dbPlace = baseMapper.selectById(appSitePlaceCuDTO.getSiteId());
+        if (null == dbPlace) throw new JeecgBootException("数据不存在", SC_INTERNAL_SERVER_ERROR_500);
+        //部门校验
+//        checkPermission(dbPlace, sysUser);
+        AppSitePlace appSitePlace = new AppSitePlace();
+        BeanUtils.copyProperties(appSitePlaceCuDTO, appSitePlace);
+        //不许更改项赋值
+        appSitePlace.setOrgCode(sysUser.getOrgCode());
+        appSitePlace.setTenantId(sysUser.getOrgId());
+        appSitePlace.setSiteId(appSitePlaceCuDTO.getSiteId());
+        int update = baseMapper.updateById(appSitePlace);
+        if (update < 1) {
+            throw new JeecgBootException("商户场所保存失败");
+        }
+        List<AppSitePriceRules> dbRulesList = appSitePriceRulesMapper.selectList(Wrappers.<AppSitePriceRules>lambdaQuery()
+                .eq(AppSitePriceRules::getSitePlaceId, appSitePlace.getId()));
+        List<AppSiteRuleDTO> siteRuleDTOS = placeDTO.getSiteRuleDTOS();
+        //删除
+        List<AppSitePriceRules> deleteList = dbRulesList.stream().filter(
+                dbRule -> dbRule.getId() != null && siteRuleDTOS.stream().noneMatch(rule -> dbRule.getId().equals(rule.getId()))).collect(Collectors.toList());
+        deleteList.forEach(
+                dbRule -> {
+                    int deleteResult = appSitePriceRulesMapper.deleteById(dbRule.getId());
+                    if (deleteResult < 1) {
+                        throw new JeecgBootException("场所价格规则删除失败");
+                    }
+                }
+        );
+        //保存
+        List<AppSitePriceRules> addList = siteRuleDTOS.stream().filter(rule -> rule.getId() == null).map(ruleDTO -> {
+            AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
+            BeanUtils.copyProperties(ruleDTO, appSitePriceRules);
+            appSitePriceRules.setOrgCode(appSitePlace.getOrgCode());
+            appSitePriceRules.setTenantId(appSitePlace.getTenantId());
+            appSitePriceRules.setSitePlaceId(appSitePlace.getId());
+            return appSitePriceRules;
+        }).collect(Collectors.toList());
+        addList.forEach(appSitePriceRules -> {
+            int saveResult = appSitePriceRulesMapper.insert(appSitePriceRules);
+            if (saveResult < 1) {
+                throw new JeecgBootException("场所价格规则保存失败", SC_INTERNAL_SERVER_ERROR_500);
+            }
+        });
+        //更新
+        List<AppSitePriceRules> updateList = siteRuleDTOS.stream().filter(
+                rule -> rule.getId() != null && dbRulesList.stream().anyMatch(
+                        dbRule -> dbRule.getId().equals(rule.getId()))).map(ruleDto -> {
+            AppSitePriceRules appSitePriceRules = new AppSitePriceRules();
+            BeanUtils.copyProperties(ruleDto, appSitePriceRules);
+            appSitePriceRules.setSitePlaceId(appSitePlace.getId());
+            appSitePriceRules.setOrgCode(appSitePlace.getOrgCode());
+            appSitePriceRules.setTenantId(appSitePlace.getTenantId());
+            return appSitePriceRules;
+        }).collect(Collectors.toList());
+        updateList.forEach(rule -> {
+            int updateById = appSitePriceRulesMapper.updateById(rule);
+            if (updateById < 1) {
+                throw new JeecgBootException("场所价格规则更新失败", SC_INTERNAL_SERVER_ERROR_500);
+            }
+        });
+        return Boolean.TRUE;
     }
 
     @Override
-    public AppSitePlaceCuDTO queryWitchPriceRulesById(String id) {
-        return null;
+    @Transactional(rollbackFor = Exception.class)
+    public AppSitePlaceDTO queryWitchPriceRulesById(String id) {
+        AppSitePlace appSitePlace = baseMapper.selectById(id);
+        if (null == appSitePlace) throw new JeecgBootException("数据不存在", SC_INTERNAL_SERVER_ERROR_500);
+        AppSitePlaceCuDTO appSitePlaceCuDTO = new AppSitePlaceCuDTO();
+        BeanUtils.copyProperties(appSitePlace, appSitePlaceCuDTO);
+        List<AppSiteRuleDTO> collect = appSitePriceRulesMapper.selectList(Wrappers.<AppSitePriceRules>lambdaQuery()
+                .eq(AppSitePriceRules::getSitePlaceId, appSitePlace.getId())).stream().map(
+                appSitePriceRules -> {
+                    AppSiteRuleDTO appSiteRuleDTO = new AppSiteRuleDTO();
+                    BeanUtils.copyProperties(appSitePriceRules, appSiteRuleDTO);
+                    return appSiteRuleDTO;
+                }).collect(Collectors.toList());
+
+        return new AppSitePlaceDTO(appSitePlaceCuDTO, collect);
     }
 
     @Override
+    @Transactional(rollbackFor = Exception.class)
     public Boolean deleteWitchPriceRulesById(String id) {
-        return null;
+        AppSitePlace dbPlace = baseMapper.selectById(id);
+        if (null==dbPlace) throw new JeecgBootException("未找到对应数据", SC_INTERNAL_SERVER_ERROR_500);
+        LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+//        checkPermission(dbPlace,sysUser);
+        int deleteById = baseMapper.deleteById(id);
+        if (deleteById < 1) throw new JeecgBootException("删除失败", SC_INTERNAL_SERVER_ERROR_500);
+        int deletePriceResult = appSitePriceRulesMapper.delete(Wrappers.<AppSitePriceRules>lambdaQuery().eq(AppSitePriceRules::getSitePlaceId, id));
+        if (deletePriceResult<1) throw new JeecgBootException("场地价格规则删除失败", SC_INTERNAL_SERVER_ERROR_500);
+        return Boolean.TRUE;
     }
 
     @Override
     public IPage<AppSitePlaceCuDTO> queryWitchPriceRulesPage(AppSitePlacePageDTO dto) {
-        return null;
+        LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
+        Page<AppSitePlace> page = new Page<>(dto.getPageNum(), dto.getPageSize());
+        LambdaQueryWrapper<AppSitePlace> wrapper = Wrappers.<AppSitePlace>lambdaQuery()
+                .like(StringUtils.isNotBlank(dto.getName()), AppSitePlace::getName, dto.getName());
+//                .eq(AppSitePlace::getOrgCode, loginUser.getOrgCode());
+        IPage<AppSitePlace> resultPage = baseMapper.selectPage(page, wrapper);
+        return resultPage.convert(record -> {
+            AppSitePlaceCuDTO cuDTO = new AppSitePlaceCuDTO();
+            BeanUtils.copyProperties(record,cuDTO);
+            return cuDTO;
+        });
     }
+
     /**
      * 权限校验
+     *
      * @param place
      * @param sysUser
      */
-    private void checkPermission(AppSitePlace place, LoginUser sysUser ){
-        if (!sysUser.getOrgCode().equals(place.getOrgCode())) throw new JeecgBootException("无权限操作", SC_INTERNAL_SERVER_ERROR_500);
+    private void checkPermission(AppSitePlace place, LoginUser sysUser) {
+        if (!sysUser.getOrgCode().equals(place.getOrgCode()))
+            throw new JeecgBootException("无权限操作", SC_INTERNAL_SERVER_ERROR_500);
     }
 }