From 1b4822da66a05ee7647f5f86a9f18f15dadb0a25 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 17 May 2024 18:13:20 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/main/java/org/springblade/modules/police/vo/PoliceAffairsGridVO.java | 30 ++---
src/main/java/org/springblade/modules/police/service/IPoliceStationService.java | 8 +
src/main/java/org/springblade/modules/police/service/IPoliceAffairsGridService.java | 7 +
src/main/java/org/springblade/modules/place/controller/PlaceController.java | 13 +-
src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.xml | 9 +
src/main/java/org/springblade/modules/police/controller/PoliceStationController.java | 7 +
src/main/java/org/springblade/modules/police/controller/PoliceAffairsGridController.java | 35 ++----
src/main/java/org/springblade/modules/police/service/impl/PoliceStationServiceImpl.java | 12 ++
src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.java | 7 +
src/main/java/org/springblade/modules/house/controller/HouseholdController.java | 13 +-
src/main/java/org/springblade/modules/police/service/impl/PoliceAffairsGridServiceImpl.java | 47 +++++++++
src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml | 49 +++++++++
src/main/java/org/springblade/modules/doorplateAddress/controller/DoorplateAddressController.java | 6
src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.java | 12 ++
14 files changed, 197 insertions(+), 58 deletions(-)
diff --git a/src/main/java/org/springblade/modules/doorplateAddress/controller/DoorplateAddressController.java b/src/main/java/org/springblade/modules/doorplateAddress/controller/DoorplateAddressController.java
index 886f04d..4595e75 100644
--- a/src/main/java/org/springblade/modules/doorplateAddress/controller/DoorplateAddressController.java
+++ b/src/main/java/org/springblade/modules/doorplateAddress/controller/DoorplateAddressController.java
@@ -68,7 +68,7 @@
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入doorplateAddress")
public R<DoorplateAddressVO> detail(DoorplateAddressEntity doorplateAddress) {
- bladeLogger.info("blade-doorplateAddress_detail", JsonUtil.toJson(doorplateAddress));
+ bladeLogger.info("门牌地址详情查询", JsonUtil.toJson(doorplateAddress));
DoorplateAddressEntity detail = doorplateAddressService.getOne(Condition.getQueryWrapper(doorplateAddress));
return R.data(DoorplateAddressWrapper.build().entityVO(detail));
}
@@ -79,7 +79,7 @@
@GetMapping("/getDetail")
@ApiLog("门牌地址表(总台账数据) 自定义详情")
public R getDetail(DoorplateAddressVO doorplateAddress) {
- bladeLogger.info("blade-doorplateAddress_getDetail", JsonUtil.toJson(doorplateAddress));
+ bladeLogger.info("门牌地址详情查询", JsonUtil.toJson(doorplateAddress));
return R.data(doorplateAddressService.getDetail(doorplateAddress));
}
@@ -155,7 +155,7 @@
@GetMapping("/getFuncList")
@ApiLog("根据角色获取功能集合数据")
public R getFuncList(Integer type,String roleName) {
- bladeLogger.info("blade-doorplateAddress_getFuncList", JsonUtil.toJson(ToObject.toMap("type:" + type,"roleName:"+ roleName)));
+ bladeLogger.info("根据角色获取功能集合数据", JsonUtil.toJson(ToObject.toMap("type:" + type,"roleName:"+ roleName)));
return R.data(doorplateAddressService.getFuncList(type,roleName));
}
diff --git a/src/main/java/org/springblade/modules/house/controller/HouseholdController.java b/src/main/java/org/springblade/modules/house/controller/HouseholdController.java
index d8febc8..0ba9196 100644
--- a/src/main/java/org/springblade/modules/house/controller/HouseholdController.java
+++ b/src/main/java/org/springblade/modules/house/controller/HouseholdController.java
@@ -72,7 +72,7 @@
@ApiLog("住户 详情")
@ApiOperation(value = "详情", notes = "传入household")
public R<HouseholdVO> detail(HouseholdEntity household) {
- bladeLogger.info("住户 详情", JsonUtil.toJson(household));
+ bladeLogger.info("住户详情查询", JsonUtil.toJson(household));
HouseholdEntity detail = householdService.getOne(Condition.getQueryWrapper(household).last("limit 1"));
return R.data(HouseholdWrapper.build().entityVO(detail));
}
@@ -87,7 +87,7 @@
@ApiLog("住户 详情")
@ApiOperation(value = "详情", notes = "传入household")
public R getDetail(HouseholdEntity household) {
- bladeLogger.info("住户 详情", JsonUtil.toJson(household));
+ bladeLogger.info("住户详情查询", JsonUtil.toJson(household));
return R.data(householdService.getDetail(household));
}
@@ -110,7 +110,7 @@
@ApiLog("住户 自定义分页")
@ApiOperation(value = "分页", notes = "传入household")
public R<IPage<HouseholdVO>> page(HouseholdVO household, Query query) {
- bladeLogger.info("住户 自定义分页", JsonUtil.toJson(household));
+ bladeLogger.info("住户列表信息查询", JsonUtil.toJson(household));
IPage<HouseholdVO> pages = householdService.selectHouseholdPage(Condition.getPage(query), household);
return R.data(pages);
}
@@ -123,7 +123,7 @@
@ApiLog("住户 自定义分页")
@ApiOperation(value = "分页", notes = "传入household")
public R<IPage<HouseholdVO>> getKeynotePersonnelPage(HouseholdVO household, Query query) {
- bladeLogger.info("住户 自定义分页", JsonUtil.toJson(household));
+ bladeLogger.info("住户列表信息查询", JsonUtil.toJson(household));
IPage<HouseholdVO> pages = householdService.getKeynotePersonnelPage(Condition.getPage(query), household);
return R.data(pages);
}
@@ -195,7 +195,7 @@
@ApiLog("住户 自定义新增或修改")
@ApiOperation(value = "自定义新增或修改", notes = "传入household")
public R saveOrUpdateHousehold(@Valid @RequestBody HouseholdVO household) {
- bladeLogger.info("住户 自定义新增或修改", JsonUtil.toJson(household));
+ bladeLogger.info("住户信息新增或修改", JsonUtil.toJson(household));
return R.status(householdService.saveOrUpdateHousehold(household));
}
@@ -208,7 +208,7 @@
@ApiOperation(value = "逻辑删除", notes = "传入ids")
@Transactional(rollbackFor = Exception.class)
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- bladeLogger.info("住户 删除", JsonUtil.toJson(ids));
+ bladeLogger.info("住户信息删除", JsonUtil.toJson(ids));
// 返回
return R.status(householdService.removeHousehold(ids));
}
@@ -232,6 +232,7 @@
@ApiOperationSupport(order = 12)
@ApiOperation(value = "导入住户", notes = "传入excel")
public R importUser(MultipartFile file, Integer isCovered) {
+ bladeLogger.info("住户信息导入", JsonUtil.toJson(isCovered));
String data = householdService.importUserHouseHold(ExcelUtil.read(file, ImportHouseholdExcel.class),isCovered==1);
return R.data(200,data,null);
}
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 952870c..f0c2ccd 100644
--- a/src/main/java/org/springblade/modules/place/controller/PlaceController.java
+++ b/src/main/java/org/springblade/modules/place/controller/PlaceController.java
@@ -91,7 +91,7 @@
@ApiOperationSupport(order = 3)
@ApiOperation(value = "分页page", notes = "传入place")
public R<IPage<PlaceVO>> page(PlaceVO place, Query query) {
- bladeLogger.info("blade-place_page", JsonUtil.toJson(place));
+ bladeLogger.info("场所列表查询", JsonUtil.toJson(place));
IPage<PlaceVO> pages = placeService.selectPlacePage(Condition.getPage(query), place);
return R.data(pages);
}
@@ -104,7 +104,7 @@
@ApiOperationSupport(order = 3)
@ApiOperation(value = "九小场所档案", notes = "传入place")
public R<IPage<PlaceVO>> ninePage(PlaceVO place, Query query) {
- bladeLogger.info("blade-place_ninePage", JsonUtil.toJson(place));
+ bladeLogger.info("九小场所档案列表查询", JsonUtil.toJson(place));
IPage<PlaceVO> pages = placeService.selectNinePlacePage(Condition.getPage(query), place);
return R.data(pages);
}
@@ -117,7 +117,7 @@
@ApiOperationSupport(order = 3)
@ApiOperation(value = "企业商超列表查询", notes = "传入place")
public R<IPage<PlaceVO>> mallPage(PlaceVO place, Query query) {
- bladeLogger.info("blade-place_mallPage", JsonUtil.toJson(place));
+ bladeLogger.info("企业商超列表查询", JsonUtil.toJson(place));
IPage<PlaceVO> pages = placeService.selectMallPage(Condition.getPage(query), place);
return R.data(pages);
}
@@ -141,7 +141,7 @@
@ApiLog("场所自定义新增")
@ApiOperation(value = "自定义新增", notes = "传入place")
public R add(@RequestBody PlaceVO placeVO){
- bladeLogger.info("场所自定义新增", JsonUtil.toJson(placeVO));
+ bladeLogger.info("场所信息采集/修改", JsonUtil.toJson(placeVO));
return R.status(placeService.addOrUpdate(placeVO));
}
@@ -155,7 +155,7 @@
@ApiLog("场所自定义新增/修改")
@ApiOperation(value = "自定义新增/修改", notes = "传入place")
public R addOrUpdate(@RequestBody PlaceVO placeVO){
- bladeLogger.info("场所自定义新增/修改", JsonUtil.toJson(placeVO));
+ bladeLogger.info("场所信息采集/修改", JsonUtil.toJson(placeVO));
return R.status(placeService.addOrUpdate(placeVO));
}
@@ -245,7 +245,7 @@
@ApiLog("场所表 自定义详情查询")
@ApiOperation(value = "场所表 自定义详情查询", notes = "传入ids")
public R<PlaceVO> getDetail(PlaceVO place) {
- bladeLogger.info("场所表 自定义详情查询", JsonUtil.toJson(place));
+ bladeLogger.info("场所表详情查询", JsonUtil.toJson(place));
return R.data(placeService.getDetail(place));
}
@@ -255,6 +255,7 @@
*/
@PostMapping("/import-place")
public R importPlace(MultipartFile file, Integer isCovered) {
+ bladeLogger.info("场所信息批量导入", JsonUtil.toJson(isCovered));
String data = placeService.importPlace(ExcelUtil.read(file, ImportPlaceExcel.class),isCovered==1);
return R.data(200,data,"");
}
diff --git a/src/main/java/org/springblade/modules/police/controller/PoliceAffairsGridController.java b/src/main/java/org/springblade/modules/police/controller/PoliceAffairsGridController.java
index 1932858..989883a 100644
--- a/src/main/java/org/springblade/modules/police/controller/PoliceAffairsGridController.java
+++ b/src/main/java/org/springblade/modules/police/controller/PoliceAffairsGridController.java
@@ -1,19 +1,3 @@
-/*
- * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the dreamlu.net developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: Chill 庄骞 (smallchill@163.com)
- */
package org.springblade.modules.police.controller;
import io.swagger.annotations.Api;
@@ -22,24 +6,21 @@
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
-
import org.springblade.core.excel.util.ExcelUtil;
-import org.springblade.core.secure.BladeUser;
+import org.springblade.core.log.logger.BladeLogger;
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.jackson.JsonUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.police.excel.PoliceAffairsGridExcel;
import org.springblade.modules.police.excel.PoliceAffairsGridImporter;
-import org.springblade.modules.police.excel.PoliceStationExcel;
-import org.springblade.modules.police.excel.PoliceStationImporter;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.police.entity.PoliceAffairsGridEntity;
import org.springblade.modules.police.vo.PoliceAffairsGridVO;
import org.springblade.modules.police.wrapper.PoliceAffairsGridWrapper;
import org.springblade.modules.police.service.IPoliceAffairsGridService;
-import org.springblade.core.boot.ctrl.BladeController;
import org.springframework.web.multipart.MultipartFile;
/**
@@ -55,6 +36,7 @@
public class PoliceAffairsGridController {
private final IPoliceAffairsGridService policeAffairsGridService;
+ private final BladeLogger bladeLogger;
/**
* 警务网格(辖区)表 详情
@@ -109,6 +91,17 @@
}
/**
+ * 警务网格(辖区)表 自定义新增或修改
+ */
+ @PostMapping("/saveOrUpdate")
+ @ApiOperationSupport(order = 8)
+ @ApiOperation(value = "自定义新增或修改", notes = "传入policeAffairsGrid")
+ public R saveOrUpdate(@Valid @RequestBody PoliceAffairsGridEntity policeAffairsGrid) {
+ bladeLogger.info("警务网格(辖区)表 自定义新增或修改",JsonUtil.toJson(policeAffairsGrid));
+ return R.status(policeAffairsGridService.saveOrUpdatePoliceAffairsGrid(policeAffairsGrid));
+ }
+
+ /**
* 警务网格(辖区)表 新增或修改
*/
@PostMapping("/submit")
diff --git a/src/main/java/org/springblade/modules/police/controller/PoliceStationController.java b/src/main/java/org/springblade/modules/police/controller/PoliceStationController.java
index 3dc9460..6f9c7ed 100644
--- a/src/main/java/org/springblade/modules/police/controller/PoliceStationController.java
+++ b/src/main/java/org/springblade/modules/police/controller/PoliceStationController.java
@@ -117,5 +117,12 @@
return R.success("操作成功");
}
+ /**
+ * 派出所树查询
+ */
+ @GetMapping("/tree")
+ public R tree(PoliceStationEntity policeStation) {
+ return R.data(policeStationService.tree(policeStation));
+ }
}
diff --git a/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.java b/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.java
index d747c31..58577de 100644
--- a/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.java
+++ b/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.java
@@ -38,7 +38,12 @@
* @param policeAffairsGrid
* @return
*/
- List<PoliceAffairsGridVO> selectPoliceAffairsGridPage(IPage page, PoliceAffairsGridVO policeAffairsGrid);
+ List<PoliceAffairsGridVO> selectPoliceAffairsGridPage(IPage page,
+ @Param("policeAffairsGrid") PoliceAffairsGridVO policeAffairsGrid,
+ @Param("isAdministrator") Integer isAdministrator,
+ @Param("regionChildCodesList") List<String> regionChildCodesList,
+ @Param("gridCodeList") List<String> gridCodeList
+ );
/**
* 空间分析
diff --git a/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml b/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml
index 39fe5ae..06ceeed 100644
--- a/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml
+++ b/src/main/java/org/springblade/modules/police/mapper/PoliceAffairsGridMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.police.mapper.PoliceAffairsGridMapper">
<!-- 通用查询映射结果 -->
- <resultMap id="policeAffairsGridResultMap" type="org.springblade.modules.police.entity.PoliceAffairsGridEntity">
+ <resultMap id="policeAffairsGridResultMap" type="org.springblade.modules.police.vo.PoliceAffairsGridVO">
<result column="id" property="id"/>
<result column="object_id" property="objectId"/>
<result column="jws_code" property="jwsCode"/>
@@ -24,9 +24,54 @@
<result column="is_deleted" property="isDeleted"/>
</resultMap>
-
+ <!--自定义分页查询-->
<select id="selectPoliceAffairsGridPage" resultMap="policeAffairsGridResultMap">
select * from jczz_police_affairs_grid where is_deleted = 0
+ <if test="policeAffairsGrid.communityName!=null and policeAffairsGrid.communityName!=''">
+ and community_name like concat('%',#{policeAffairsGrid.communityName},'%')
+ </if>
+ <if test="policeAffairsGrid.jwGridCode!=null and policeAffairsGrid.jwGridCode!=''">
+ and jw_grid_code like concat('%',#{policeAffairsGrid.jwGridCode},'%')
+ </if>
+ <if test="policeAffairsGrid.pcsCode!=null and policeAffairsGrid.pcsCode!=''">
+ and pcs_code like concat('%',#{policeAffairsGrid.pcsCode},'%')
+ </if>
+ <if test="policeAffairsGrid.pcsName!=null and policeAffairsGrid.pcsName!=''">
+ and pcs_name like concat('%',#{policeAffairsGrid.pcsName},'%')
+ </if>
+ <if test="isAdministrator==2">
+ <choose>
+ <when test="policeAffairsGrid.roleName != null and policeAffairsGrid.roleName != ''">
+ <if test="policeAffairsGrid.roleName=='mj'">
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and community_code in ('')
+ </otherwise>
+ </choose>
+ </if>
+ </when>
+ <otherwise>
+ <choose>
+ <when test="regionChildCodesList !=null and regionChildCodesList.size()>0">
+ and community_code in
+ <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=",">
+ #{code}
+ </foreach>
+ </when>
+ <otherwise>
+ and community_code in ('')
+ </otherwise>
+ </choose>
+ </otherwise>
+ </choose>
+ </if>
+ order by id desc,pcs_code desc
</select>
<!--判断该点在哪个警务网格-->
diff --git a/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.java b/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.java
index cc4ea53..c19d3ba 100644
--- a/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.java
+++ b/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.java
@@ -16,11 +16,15 @@
*/
package org.springblade.modules.police.mapper;
+import org.apache.ibatis.annotations.MapKey;
+import org.apache.ibatis.annotations.Param;
+import org.springblade.common.node.TreeStringNode;
import org.springblade.modules.police.entity.PoliceStationEntity;
import org.springblade.modules.police.vo.PoliceStationVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.List;
+import java.util.Map;
/**
* 派出所信息表 Mapper 接口
@@ -39,5 +43,11 @@
*/
List<PoliceStationVO> selectPoliceStationPage(IPage page, PoliceStationVO policeStation);
-
+ /**
+ * 派出所树查询
+ * @param policeStation
+ * @return
+ */
+ @MapKey(value = "id")
+ Map<String, TreeStringNode> tree(@Param("policeStation") PoliceStationEntity policeStation);
}
diff --git a/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.xml b/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.xml
index 2a01801..558b840 100644
--- a/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.xml
+++ b/src/main/java/org/springblade/modules/police/mapper/PoliceStationMapper.xml
@@ -22,5 +22,14 @@
select * from jczz_police_station where is_deleted = 0
</select>
+ <!--派出所树查询-->
+ <select id="tree" resultType="org.springblade.common.node.TreeStringNode">
+ SELECT
+ code as id,
+ parent_code as parentId,
+ name
+ FROM jczz_police_station
+ </select>
+
</mapper>
diff --git a/src/main/java/org/springblade/modules/police/service/IPoliceAffairsGridService.java b/src/main/java/org/springblade/modules/police/service/IPoliceAffairsGridService.java
index 682bdbd..5dd9abf 100644
--- a/src/main/java/org/springblade/modules/police/service/IPoliceAffairsGridService.java
+++ b/src/main/java/org/springblade/modules/police/service/IPoliceAffairsGridService.java
@@ -46,4 +46,11 @@
* @return
*/
List<String> getCommunityCodeListByUserId(Long userId);
+
+ /**
+ * 警务网格(辖区)表 自定义新增或修改
+ * @param policeAffairsGrid
+ * @return
+ */
+ boolean saveOrUpdatePoliceAffairsGrid(PoliceAffairsGridEntity policeAffairsGrid);
}
diff --git a/src/main/java/org/springblade/modules/police/service/IPoliceStationService.java b/src/main/java/org/springblade/modules/police/service/IPoliceStationService.java
index f1ce932..a606876 100644
--- a/src/main/java/org/springblade/modules/police/service/IPoliceStationService.java
+++ b/src/main/java/org/springblade/modules/police/service/IPoliceStationService.java
@@ -1,6 +1,7 @@
package org.springblade.modules.police.service;
import com.baomidou.mybatisplus.extension.service.IService;
+import org.springblade.common.node.TreeStringNode;
import org.springblade.modules.police.entity.PoliceStationEntity;
import org.springblade.modules.police.excel.PoliceStationExcel;
import org.springblade.modules.police.vo.PoliceStationVO;
@@ -32,4 +33,11 @@
* @param isCovered
*/
void importPoliceStation(List<PoliceStationExcel> data, Boolean isCovered);
+
+ /**
+ * 派出所树查询
+ * @param policeStation
+ * @return
+ */
+ List<TreeStringNode> tree(PoliceStationEntity policeStation);
}
diff --git a/src/main/java/org/springblade/modules/police/service/impl/PoliceAffairsGridServiceImpl.java b/src/main/java/org/springblade/modules/police/service/impl/PoliceAffairsGridServiceImpl.java
index 6774fad..60e64da 100644
--- a/src/main/java/org/springblade/modules/police/service/impl/PoliceAffairsGridServiceImpl.java
+++ b/src/main/java/org/springblade/modules/police/service/impl/PoliceAffairsGridServiceImpl.java
@@ -2,9 +2,13 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.common.param.CommonParamSet;
+import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.SpringUtil;
+import org.springblade.modules.community.entity.CommunityEntity;
+import org.springblade.modules.community.service.ICommunityService;
import org.springblade.modules.police.entity.PoliceAffairsGridEntity;
import org.springblade.modules.police.entity.PoliceStationEntity;
import org.springblade.modules.police.excel.PoliceAffairsGridExcel;
@@ -32,7 +36,13 @@
@Override
public IPage<PoliceAffairsGridVO> selectPoliceAffairsGridPage(IPage<PoliceAffairsGridVO> page, PoliceAffairsGridVO policeAffairsGrid) {
- return page.setRecords(baseMapper.selectPoliceAffairsGridPage(page, policeAffairsGrid));
+ CommonParamSet commonParamSet = new CommonParamSet<>().invoke(PoliceAffairsGridVO.class, policeAffairsGrid);
+ return page.setRecords(baseMapper.selectPoliceAffairsGridPage(page,
+ policeAffairsGrid,
+ commonParamSet.getIsAdministrator(),
+ commonParamSet.getRegionChildCodesList(),
+ commonParamSet.getGridCodeList()
+ ));
}
/**
@@ -80,4 +90,39 @@
public List<String> getCommunityCodeListByUserId(Long userId) {
return baseMapper.getCommunityCodeListByUserId(userId.toString());
}
+
+ /**
+ * 警务网格(辖区)表 自定义新增或修改
+ * @param policeAffairsGrid
+ * @return
+ */
+ @Override
+ public boolean saveOrUpdatePoliceAffairsGrid(PoliceAffairsGridEntity policeAffairsGrid) {
+ boolean flag = false;
+ // 查询对应的派出所及社区名称
+ IPoliceStationService policeStationService = SpringUtils.getBean(IPoliceStationService.class);
+ QueryWrapper<PoliceStationEntity> queryWrapper = new QueryWrapper<>();
+ queryWrapper.eq("code",policeAffairsGrid.getPcsCode());
+ List<PoliceStationEntity> policeStationEntityList = policeStationService.list(queryWrapper);
+ if (policeStationEntityList.size()>0){
+ policeAffairsGrid.setPcsName(policeStationEntityList.get(0).getName());
+ }
+ ICommunityService communityService = SpringUtils.getBean(ICommunityService.class);
+ QueryWrapper<CommunityEntity> wrapper = new QueryWrapper<>();
+ wrapper.eq("code",policeAffairsGrid.getCommunityCode());
+ List<CommunityEntity> communityEntityList = communityService.list(wrapper);
+ if (communityEntityList.size()>0){
+ policeAffairsGrid.setCommunityName(communityEntityList.get(0).getName());
+ }
+ if (null!=policeAffairsGrid.getId()){
+ policeAffairsGrid.setGeom(null);
+ // 更新
+ flag = updateById(policeAffairsGrid);
+ }else {
+ policeAffairsGrid.setGeom(null);
+ // 新增
+ flag = save(policeAffairsGrid);
+ }
+ return flag;
+ }
}
diff --git a/src/main/java/org/springblade/modules/police/service/impl/PoliceStationServiceImpl.java b/src/main/java/org/springblade/modules/police/service/impl/PoliceStationServiceImpl.java
index b4978ee..d047970 100644
--- a/src/main/java/org/springblade/modules/police/service/impl/PoliceStationServiceImpl.java
+++ b/src/main/java/org/springblade/modules/police/service/impl/PoliceStationServiceImpl.java
@@ -2,6 +2,8 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springblade.common.node.TreeStringNode;
+import org.springblade.common.utils.NodeTreeUtil;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.police.entity.PoliceStationEntity;
import org.springblade.modules.police.excel.PoliceStationExcel;
@@ -59,4 +61,14 @@
}
}
}
+
+ /**
+ * 派出所树查询
+ * @param policeStation
+ * @return
+ */
+ @Override
+ public List<TreeStringNode> tree(PoliceStationEntity policeStation) {
+ return NodeTreeUtil.getStringNodeTree(baseMapper.tree(policeStation));
+ }
}
diff --git a/src/main/java/org/springblade/modules/police/vo/PoliceAffairsGridVO.java b/src/main/java/org/springblade/modules/police/vo/PoliceAffairsGridVO.java
index a1ccc26..7676296 100644
--- a/src/main/java/org/springblade/modules/police/vo/PoliceAffairsGridVO.java
+++ b/src/main/java/org/springblade/modules/police/vo/PoliceAffairsGridVO.java
@@ -1,23 +1,7 @@
-/*
- * Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- *
- * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * Neither the name of the dreamlu.net developer nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- * Author: Chill 庄骞 (smallchill@163.com)
- */
package org.springblade.modules.police.vo;
+import io.swagger.annotations.ApiModelProperty;
import org.springblade.modules.police.entity.PoliceAffairsGridEntity;
-import org.springblade.core.tool.node.INode;
import lombok.Data;
import lombok.EqualsAndHashCode;
@@ -32,4 +16,16 @@
public class PoliceAffairsGridVO extends PoliceAffairsGridEntity {
private static final long serialVersionUID = 1L;
+ /**
+ * 社区编号
+ */
+ @ApiModelProperty(value = "社区编号")
+ private String communityCode;
+
+ /**
+ * 角色别名
+ */
+ @ApiModelProperty(value = "角色别名")
+ private String roleName;
+
}
--
Gitblit v1.9.3