From aeb7d068be92312dcdcea75e1240bcf2a78dd0fe Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Mon, 29 Jul 2024 16:49:58 +0800
Subject: [PATCH] 代码优化
---
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml | 419 +++++++++++++++++++++++
src/main/java/org/springblade/modules/checkInRecords/service/ICheckInRecordsService.java | 6
src/main/java/org/springblade/modules/grid/excel/GridPatrolRecordExcel.java | 71 +++
src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.xml | 94 ++++
src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java | 30 +
src/main/java/org/springblade/modules/checkInRecords/entity/CheckInRecordsEntity.java | 10
src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml | 13
pom.xml | 20
src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java | 40 ++
src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml | 8
src/main/java/org/springblade/modules/grid/service/impl/GridPatrolRecordServiceImpl.java | 63 +++
src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java | 20 +
src/main/java/org/springblade/modules/checkInRecords/controller/CheckInRecordsController.java | 11
src/main/java/org/springblade/modules/checkInRecords/service/impl/CheckInRecordsServiceImpl.java | 36 ++
src/main/java/org/springblade/modules/checkInRecords/vo/CheckInRecordsVO.java | 16
src/main/java/org/springblade/modules/backblast/entity/BackblastWarnHanRecEntity.java | 2
src/main/java/org/springblade/modules/backblast/controller/BackblastPubPersonController.java | 32
src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java | 19 +
src/main/java/org/springblade/modules/house/vo/HouseholdLabelVO.java | 9
src/main/java/org/springblade/modules/task/controller/TaskPlaceRectificationController.java | 4
src/main/java/org/springblade/modules/grid/controller/GridPatrolRecordController.java | 21 +
src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.java | 15
src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml | 2
src/main/java/org/springblade/common/utils/WordToPdfUtils.java | 28
src/main/java/org/springblade/modules/grid/entity/GridPatrolRecordEntity.java | 10
src/main/java/org/springblade/modules/grid/vo/GridPatrolRecordVO.java | 18
src/main/java/org/springblade/modules/grid/service/IGridPatrolRecordService.java | 15
src/main/resources/application.yml | 2
src/main/java/org/springblade/modules/task/service/impl/TaskNoFraudReportingServiceImpl.java | 16
29 files changed, 953 insertions(+), 97 deletions(-)
diff --git a/pom.xml b/pom.xml
index 5d0bce9..c804d0a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -355,16 +355,16 @@
<version>1.7.6</version>
</dependency>
- <dependency>
- <groupId>com.luhuiguo</groupId>
- <artifactId>aspose-pdf</artifactId>
- <version>23.1</version>
- </dependency>
- <dependency>
- <groupId>com.luhuiguo</groupId>
- <artifactId>aspose-words</artifactId>
- <version>23.1</version>
- </dependency>
+<!-- <dependency>-->
+<!-- <groupId>com.luhuiguo</groupId>-->
+<!-- <artifactId>aspose-pdf</artifactId>-->
+<!-- <version>23.1</version>-->
+<!-- </dependency>-->
+<!-- <dependency>-->
+<!-- <groupId>com.luhuiguo</groupId>-->
+<!-- <artifactId>aspose-words</artifactId>-->
+<!-- <version>23.1</version>-->
+<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
diff --git a/src/main/java/org/springblade/common/utils/WordToPdfUtils.java b/src/main/java/org/springblade/common/utils/WordToPdfUtils.java
index 011a972..7b23f8c 100644
--- a/src/main/java/org/springblade/common/utils/WordToPdfUtils.java
+++ b/src/main/java/org/springblade/common/utils/WordToPdfUtils.java
@@ -1,9 +1,5 @@
package org.springblade.common.utils;
-import java.io.InputStream;
-import java.net.HttpURLConnection;
-import java.net.URL;
-
public class WordToPdfUtils {
// https://srgdjczzxtpt.com:2080/gminio/jczz/upload/20240710/ade086b8d725a08631b62d812a63f6da.docx
@@ -15,18 +11,18 @@
// 判断文件后缀名是否doc,ppt,xls
if (fileName.endsWith(".doc") || fileName.endsWith(".docx")) {
// 获取文件流
- URL url = new URL(pdfPath);
- HttpURLConnection connection = (HttpURLConnection) url.openConnection();
- connection.setRequestProperty("User-Agent", "Mozilla/5.0");
- // 获取文件名
- String orFileName = fileName.substring(0, fileName.lastIndexOf("."));
- InputStream inputStream = connection.getInputStream();
- long timeMillis = System.currentTimeMillis();
- // String filePathPdf = "/data/app/jczz/pdf/" + orFileName + "_" + timeMillis + ".pdf";
- String filePathPdf = "D:\\公司\\" + orFileName + "_" + timeMillis + ".pdf";
- com.aspose.words.Document doc = new com.aspose.words.Document(inputStream);
- doc.save(filePathPdf, com.aspose.words.SaveFormat.PDF);
- return filePathPdf;
+ // URL url = new URL(pdfPath);
+ // HttpURLConnection connection = (HttpURLConnection) url.openConnection();
+ // connection.setRequestProperty("User-Agent", "Mozilla/5.0");
+ // // 获取文件名
+ // String orFileName = fileName.substring(0, fileName.lastIndexOf("."));
+ // InputStream inputStream = connection.getInputStream();
+ // long timeMillis = System.currentTimeMillis();
+ // // String filePathPdf = "/data/app/jczz/pdf/" + orFileName + "_" + timeMillis + ".pdf";
+ // String filePathPdf = "D:\\公司\\" + orFileName + "_" + timeMillis + ".pdf";
+ // com.aspose.words.Document doc = new com.aspose.words.Document(inputStream);
+ // doc.save(filePathPdf, com.aspose.words.SaveFormat.PDF);
+ return "";
} else {
throw new Exception("文件格式不正确");
}
diff --git a/src/main/java/org/springblade/modules/backblast/controller/BackblastPubPersonController.java b/src/main/java/org/springblade/modules/backblast/controller/BackblastPubPersonController.java
index d662ec2..b45b2dc 100644
--- a/src/main/java/org/springblade/modules/backblast/controller/BackblastPubPersonController.java
+++ b/src/main/java/org/springblade/modules/backblast/controller/BackblastPubPersonController.java
@@ -38,7 +38,7 @@
import javax.validation.Valid;
/**
- * 反炸宣传对象表 控制器
+ * 反诈宣传对象表 控制器
*
* @author BladeX
* @since 2024-03-15
@@ -46,14 +46,14 @@
@RestController
@AllArgsConstructor
@RequestMapping("blade-backblastPubPerson/backblastPubPerson")
-@Api(value = "反炸宣传对象表", tags = "反炸宣传对象表接口")
+@Api(value = "反诈宣传对象表", tags = "反诈宣传对象表接口")
public class BackblastPubPersonController {
private final IBackblastPubPersonService backblastPubPersonService;
private final BladeLogger bladeLogger;
/**
- * 反炸宣传对象表 详情
+ * 反诈宣传对象表 详情
*/
@GetMapping("/detail")
@ApiOperationSupport(order = 1)
@@ -63,7 +63,7 @@
return R.data(detail);
}
/**
- * 反炸宣传对象表 分页
+ * 反诈宣传对象表 分页
*/
@GetMapping("/list")
@ApiOperationSupport(order = 2)
@@ -74,20 +74,20 @@
}
/**
- * 反炸宣传对象表 自定义分页
+ * 反诈宣传对象表 自定义分页
*/
@GetMapping("/page")
@ApiOperationSupport(order = 3)
- @ApiLog("反炸宣传对象表 自定义分页")
+ @ApiLog("反诈宣传对象表 自定义分页")
@ApiOperation(value = "分页", notes = "传入backblastPubPerson")
public R<IPage<BackblastPubPersonVO>> page(BackblastPubPersonVO backblastPubPerson, Query query) {
- bladeLogger.info("反炸宣传对象表 自定义分页", JsonUtil.toJson(backblastPubPerson));
+ bladeLogger.info("反诈宣传对象表 自定义分页", JsonUtil.toJson(backblastPubPerson));
IPage<BackblastPubPersonVO> pages = backblastPubPersonService.selectBackblastPubPersonPage(Condition.getPage(query), backblastPubPerson);
return R.data(pages);
}
/**
- * 反炸宣传对象表 新增
+ * 反诈宣传对象表 新增
*/
@PostMapping("/save")
@ApiOperationSupport(order = 4)
@@ -97,7 +97,7 @@
}
/**
- * 反炸宣传对象表 修改
+ * 反诈宣传对象表 修改
*/
@PostMapping("/update")
@ApiOperationSupport(order = 5)
@@ -107,7 +107,7 @@
}
/**
- * 反炸宣传对象表 新增或修改
+ * 反诈宣传对象表 新增或修改
*/
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@@ -117,28 +117,28 @@
}
/**
- * 反炸宣传对象表 删除
+ * 反诈宣传对象表 删除
*/
@PostMapping("/remove")
@ApiOperationSupport(order = 7)
- @ApiLog("反炸宣传对象表 删除")
+ @ApiLog("反诈宣传对象表 删除")
@ApiOperation(value = "逻辑删除", notes = "传入ids")
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
- bladeLogger.info("反炸宣传对象表 删除", JsonUtil.toJson(ids));
+ bladeLogger.info("反诈宣传对象表 删除", JsonUtil.toJson(ids));
return R.status(backblastPubPersonService.removeByIds(Func.toLongList(ids)));
}
/**
- * 反炸宣传对象表 自定义详情
+ * 反诈宣传对象表 自定义详情
* @param backblastPubPerson
* @return
*/
@GetMapping("/getDetail")
@ApiOperationSupport(order = 9)
- @ApiLog("反炸宣传对象表 自定义详情")
+ @ApiLog("反诈宣传对象表 自定义详情")
@ApiOperation(value = "详情", notes = "传入backblastPubPerson")
public R getDetail(BackblastPubPersonVO backblastPubPerson) {
- bladeLogger.info("反炸宣传对象表 自定义详情", JsonUtil.toJson(backblastPubPerson));
+ bladeLogger.info("反诈宣传对象表 自定义详情", JsonUtil.toJson(backblastPubPerson));
BackblastPubPersonVO detail = backblastPubPersonService.getDetail(backblastPubPerson);
return R.data(detail);
}
diff --git a/src/main/java/org/springblade/modules/backblast/entity/BackblastWarnHanRecEntity.java b/src/main/java/org/springblade/modules/backblast/entity/BackblastWarnHanRecEntity.java
index 10fc999..38f8519 100644
--- a/src/main/java/org/springblade/modules/backblast/entity/BackblastWarnHanRecEntity.java
+++ b/src/main/java/org/springblade/modules/backblast/entity/BackblastWarnHanRecEntity.java
@@ -101,6 +101,6 @@
/** 是否删除 0:否 1:是 */
@ApiModelProperty(value = "是否删除 0:否 1:是", example = "")
@TableField("is_deleted")
- @TableLogic
+ // @TableLogic
private Integer isDeleted;
}
diff --git a/src/main/java/org/springblade/modules/checkInRecords/controller/CheckInRecordsController.java b/src/main/java/org/springblade/modules/checkInRecords/controller/CheckInRecordsController.java
index 5b3dea5..4aa0477 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/controller/CheckInRecordsController.java
+++ b/src/main/java/org/springblade/modules/checkInRecords/controller/CheckInRecordsController.java
@@ -23,12 +23,18 @@
import lombok.AllArgsConstructor;
import javax.validation.Valid;
+import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.grid.entity.GridEntity;
+import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
+import org.springblade.modules.grid.service.IGridService;
+import org.springblade.modules.police.entity.PoliceAffairsGridEntity;
+import org.springblade.modules.police.service.IPoliceAffairsGridService;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.checkInRecords.entity.CheckInRecordsEntity;
@@ -36,6 +42,8 @@
import org.springblade.modules.checkInRecords.wrapper.CheckInRecordsWrapper;
import org.springblade.modules.checkInRecords.service.ICheckInRecordsService;
import org.springblade.core.boot.ctrl.BladeController;
+
+import java.util.List;
/**
* 打卡记录表 控制器
@@ -90,8 +98,7 @@
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入checkInRecords")
public R save(@Valid @RequestBody CheckInRecordsEntity checkInRecords) {
- checkInRecords.setCreateUserId(AuthUtil.getUserId());
- return R.status(checkInRecordsService.save(checkInRecords));
+ return R.status(checkInRecordsService.saveCheckInRecords(checkInRecords));
}
/**
diff --git a/src/main/java/org/springblade/modules/checkInRecords/entity/CheckInRecordsEntity.java b/src/main/java/org/springblade/modules/checkInRecords/entity/CheckInRecordsEntity.java
index 3403c2e..f81f059 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/entity/CheckInRecordsEntity.java
+++ b/src/main/java/org/springblade/modules/checkInRecords/entity/CheckInRecordsEntity.java
@@ -92,4 +92,14 @@
@TableLogic
private Integer deletedFlag;
+ @ApiModelProperty(value = "网格编号")
+ @TableField("grid_code")
+ private String gridCode;
+ /**
+ * 警务网格编号
+ */
+ @ApiModelProperty(value = "警务网格编号")
+ @TableField("jw_grid_code")
+ private String jwGridCode;
+
}
diff --git a/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml b/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
index 642c787..a9b6cda 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
+++ b/src/main/java/org/springblade/modules/checkInRecords/mapper/CheckInRecordsMapper.xml
@@ -20,12 +20,23 @@
jcir.address,
jcir.deleted_flag,
bu.`name`,
- bd.region_code
+ bd.region_code,
+ br.town_name as townStreetName,
+ br.name as neiName
FROM
jczz_check_in_records jcir
LEFT JOIN blade_user bu ON bu.id = jcir.create_user_id
LEFT JOIN blade_dept bd on bd.id = bu.dept_id
+ LEFT JOIN jczz_grid jg on jg.grid_code=jcir.grid_code
+ LEFT JOIN blade_region br on br.code = jg.community_code
<where>
+ <if test="checkInRecords.townStreetName!=null and checkInRecords.townStreetName!=''">
+ and br.town_name like concat('%',#{checkInRecords.townStreetName},'%')
+ </if>
+
+ <if test="checkInRecords.neiName!=null and checkInRecords.neiName!=''">
+ and br.name like concat('%',#{checkInRecords.neiName},'%')
+ </if>
<if test="checkInRecords.id != null ">and jcir.id = #{checkInRecords.id}</if>
<if test="checkInRecords.createUserId != null ">and jcir.create_user_id = #{checkInRecords.createUserId}
</if>
diff --git a/src/main/java/org/springblade/modules/checkInRecords/service/ICheckInRecordsService.java b/src/main/java/org/springblade/modules/checkInRecords/service/ICheckInRecordsService.java
index 6d8bf84..ec9e423 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/service/ICheckInRecordsService.java
+++ b/src/main/java/org/springblade/modules/checkInRecords/service/ICheckInRecordsService.java
@@ -59,4 +59,10 @@
public List<CheckInRecordsDTO> selectCheckInRecordsList(CheckInRecordsDTO checkInRecordsDTO);
+ /**
+ *
+ * @param checkInRecords
+ * @return
+ */
+ boolean saveCheckInRecords(CheckInRecordsEntity checkInRecords);
}
diff --git a/src/main/java/org/springblade/modules/checkInRecords/service/impl/CheckInRecordsServiceImpl.java b/src/main/java/org/springblade/modules/checkInRecords/service/impl/CheckInRecordsServiceImpl.java
index 597e1fb..5b39532 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/service/impl/CheckInRecordsServiceImpl.java
+++ b/src/main/java/org/springblade/modules/checkInRecords/service/impl/CheckInRecordsServiceImpl.java
@@ -19,12 +19,18 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
import org.springblade.common.cache.SysCache;
+import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.modules.checkInRecords.dto.CheckInRecordsDTO;
import org.springblade.modules.checkInRecords.entity.CheckInRecordsEntity;
import org.springblade.modules.checkInRecords.vo.CheckInRecordsVO;
import org.springblade.modules.checkInRecords.mapper.CheckInRecordsMapper;
import org.springblade.modules.checkInRecords.service.ICheckInRecordsService;
+import org.springblade.modules.grid.entity.GridEntity;
+import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
+import org.springblade.modules.grid.service.IGridService;
+import org.springblade.modules.police.entity.PoliceAffairsGridEntity;
+import org.springblade.modules.police.service.IPoliceAffairsGridService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -77,4 +83,34 @@
return this.baseMapper.selectCheckInRecordsList(checkInRecordsDTO);
}
+ @Override
+ public boolean saveCheckInRecords(CheckInRecordsEntity checkInRecords) {
+ checkInRecords.setCreateUserId(AuthUtil.getUserId());
+ setGridInfo(checkInRecords);
+ return save(checkInRecords);
+ }
+
+
+ /**
+ * 设置警格网格信息
+ * @param checkInRecords
+ */
+ public void setGridInfo(CheckInRecordsEntity checkInRecords) {
+ // 根据位置设置网格,警格编号
+ IGridService gridService = SpringUtils.getBean(IGridService.class);
+ IPoliceAffairsGridService policeAffairsGridService = SpringUtils.getBean(IPoliceAffairsGridService.class);
+ String point = "'POINT(" + checkInRecords.getLng() + " " + checkInRecords.getLat() + ")'";
+ //点坐标解析网格
+ List<GridEntity> gridEntityList = gridService.spatialAnalysis(point);
+ if (gridEntityList.size()>0){
+ GridEntity gridEntity = gridEntityList.get(0);
+ checkInRecords.setGridCode(gridEntity.getGridCode());
+ }
+ //点坐标解析警格
+ List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point);
+ if (policeAffairsGridEntityList.size()>0){
+ PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0);
+ checkInRecords.setJwGridCode(policeAffairsGridEntity.getJwGridCode());
+ }
+ }
}
diff --git a/src/main/java/org/springblade/modules/checkInRecords/vo/CheckInRecordsVO.java b/src/main/java/org/springblade/modules/checkInRecords/vo/CheckInRecordsVO.java
index 4ec46fc..358edd0 100644
--- a/src/main/java/org/springblade/modules/checkInRecords/vo/CheckInRecordsVO.java
+++ b/src/main/java/org/springblade/modules/checkInRecords/vo/CheckInRecordsVO.java
@@ -32,16 +32,13 @@
public class CheckInRecordsVO extends CheckInRecordsEntity {
private static final long serialVersionUID = 1L;
+ @ApiModelProperty(value = "用户名称", example = "")
private String name;
- /**
- * 开始时间
- */
+ @ApiModelProperty(value = "开始时间", example = "")
private String startTime;
- /**
- * 结束时间
- */
+ @ApiModelProperty(value = "结束时间", example = "")
private String endTime;
private String deptId;
@@ -54,4 +51,11 @@
@ApiModelProperty(value = "社区编号", example = "")
private String communityCode;
+
+ @ApiModelProperty(value = "街道名称", required = true)
+ private String townStreetName;
+
+ @ApiModelProperty(value = "社区名称", required = true)
+ private String neiName;
+
}
diff --git a/src/main/java/org/springblade/modules/grid/controller/GridPatrolRecordController.java b/src/main/java/org/springblade/modules/grid/controller/GridPatrolRecordController.java
index 9b45436..318e9d2 100644
--- a/src/main/java/org/springblade/modules/grid/controller/GridPatrolRecordController.java
+++ b/src/main/java/org/springblade/modules/grid/controller/GridPatrolRecordController.java
@@ -21,14 +21,20 @@
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.excel.util.ExcelUtil;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
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.backblast.excel.BackblastPubRecordExcel;
+import org.springblade.modules.grid.excel.GridPatrolRecordExcel;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
@@ -38,6 +44,7 @@
import org.springblade.core.boot.ctrl.BladeController;
import java.util.Date;
+import java.util.List;
/**
* 网格巡查记录表 控制器
@@ -92,9 +99,7 @@
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入gridPatrolRecord")
public R save(@Valid @RequestBody GridPatrolRecordEntity gridPatrolRecord) {
- gridPatrolRecord.setCreateTime(new Date());
- gridPatrolRecord.setCreateUser(AuthUtil.getUserId());
- return R.status(gridPatrolRecordService.save(gridPatrolRecord));
+ return R.status(gridPatrolRecordService.saveGridPatrolRecord(gridPatrolRecord));
}
/**
@@ -127,5 +132,15 @@
return R.status(gridPatrolRecordService.removeByIds(Func.toLongList(ids)));
}
+ // 导出网格巡查记录表
+ @GetMapping("/export")
+ @ApiOperationSupport(order = 8)
+ @ApiOperation(value = "导出", notes = "传入gridPatrolRecord")
+ public void export(GridPatrolRecordVO gridPatrolRecord, HttpServletResponse response) {
+ List<GridPatrolRecordExcel> list = gridPatrolRecordService.export(gridPatrolRecord);
+ ExcelUtil.export(response, "网格巡查记录" + DateUtil.time(), "网格巡查记录数据表", list, GridPatrolRecordExcel.class);
+
+ }
+
}
diff --git a/src/main/java/org/springblade/modules/grid/entity/GridPatrolRecordEntity.java b/src/main/java/org/springblade/modules/grid/entity/GridPatrolRecordEntity.java
index e075656..ede1b64 100644
--- a/src/main/java/org/springblade/modules/grid/entity/GridPatrolRecordEntity.java
+++ b/src/main/java/org/springblade/modules/grid/entity/GridPatrolRecordEntity.java
@@ -99,4 +99,14 @@
@TableField("location")
private String location;
+ @ApiModelProperty(value = "网格编号")
+ @TableField("grid_code")
+ private String gridCode;
+ /**
+ * 警务网格编号
+ */
+ @ApiModelProperty(value = "警务网格编号")
+ @TableField("jw_grid_code")
+ private String jwGridCode;
+
}
diff --git a/src/main/java/org/springblade/modules/grid/excel/GridPatrolRecordExcel.java b/src/main/java/org/springblade/modules/grid/excel/GridPatrolRecordExcel.java
new file mode 100644
index 0000000..d8802ce
--- /dev/null
+++ b/src/main/java/org/springblade/modules/grid/excel/GridPatrolRecordExcel.java
@@ -0,0 +1,71 @@
+/*
+ * 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.grid.excel;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 网格巡查记录表 实体类
+ *
+ * @author BladeX
+ * @since 2023-11-16
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class GridPatrolRecordExcel implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ @ExcelProperty(value = "巡查人名称")
+ private String userName;
+
+ @ExcelProperty(value = "街道名称")
+ private String townStreetName;
+
+ @ExcelProperty(value = "社区名称")
+ private String neiName;
+
+ @ExcelProperty(value = "名称")
+ private String name;
+
+ @ExcelProperty(value = "内容")
+ private String context;
+
+ @ExcelProperty(value = "巡查时间")
+ private Date patrolTime;
+
+ @ExcelProperty(value = "创建时间")
+ private Date createTime;
+
+ @ExcelProperty(value = "纬度")
+ private String latitude;
+
+ @ExcelProperty(value = "经度")
+ private String longitude;
+
+ @ExcelProperty(value = "地址")
+ private String location;
+
+}
diff --git a/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.java b/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.java
index 26d9479..920d8bf 100644
--- a/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.java
+++ b/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.java
@@ -17,7 +17,9 @@
package org.springblade.modules.grid.mapper;
import org.apache.ibatis.annotations.Param;
+import org.springblade.modules.backblast.vo.BackblastPubRecordVO;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
+import org.springblade.modules.grid.excel.GridPatrolRecordExcel;
import org.springblade.modules.grid.vo.GridPatrolRecordVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -43,5 +45,16 @@
@Param("regionChildCodesList") List<String> regionChildCodesList,
@Param("isAdministrator") Integer isAdministrator);
-
+ /**
+ * 导出
+ * @param gridPatrolRecord
+ * @param isAdministrator
+ * @param regionChildCodesList
+ * @param gridCodeList
+ * @return
+ */
+ List<GridPatrolRecordExcel> selectGridPatrolRecordExport(@Param("gridPatrolRecord") GridPatrolRecordVO gridPatrolRecord,
+ @Param("isAdministrator") Integer isAdministrator,
+ @Param("regionChildCodesList") List<String> regionChildCodesList,
+ @Param("gridCodeList") List<String> gridCodeList);
}
diff --git a/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.xml b/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.xml
index 8c7c860..72e420f 100644
--- a/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.xml
+++ b/src/main/java/org/springblade/modules/grid/mapper/GridPatrolRecordMapper.xml
@@ -19,21 +19,89 @@
<!--自定义分页查询-->
<select id="selectGridPatrolRecordPage" resultType="org.springblade.modules.grid.vo.GridPatrolRecordVO">
- select jgpr.* from jczz_grid_patrol_record jgpr
- LEFT JOIN blade_user bu on bu.id = jgpr.create_user and bu.is_deleted = 0
- LEFT JOIN blade_dept bd on bd.id = bu.dept_id and bd.is_deleted = 0
- where jgpr.is_deleted = 0
- <if test="gridPatrolRecord.name!=null and gridPatrolRecord.name!=''">
- and jgpr.name like concat('%',#{gridPatrolRecord.name},'%')
- </if>
- <if test="gridPatrolRecord.context!=null and gridPatrolRecord.context!=''">
- and jgpr.context like concat('%',#{gridPatrolRecord.context},'%')
- </if>
- <if test="gridPatrolRecord.createUser!=null">
- and jgpr.create_user = #{gridPatrolRecord.createUser}
- </if>
+ select
+ jgpr.*,
+ bu.name as userName,
+ br.town_name as townStreetName,
+ br.name as neiName
+ FROM
+ jczz_grid_patrol_record jgpr
+ LEFT JOIN blade_user bu ON bu.id = jgpr.create_user
+ LEFT JOIN blade_dept bd ON bd.id = bu.dept_id
+ LEFT JOIN jczz_grid jg on jg.grid_code=jgpr.grid_code
+ LEFT JOIN blade_region br on br.code = jg.community_code
+ <where>
+ <if test="gridPatrolRecord.name!=null and gridPatrolRecord.name!=''">
+ and jgpr.name like concat('%',#{gridPatrolRecord.name},'%')
+ </if>
+
+ <if test="gridPatrolRecord.userName!=null and gridPatrolRecord.userName!=''">
+ and bu.name like concat('%',#{gridPatrolRecord.userName},'%')
+ </if>
+
+ <if test="gridPatrolRecord.townStreetName!=null and gridPatrolRecord.townStreetName!=''">
+ and br.town_name like concat('%',#{gridPatrolRecord.townStreetName},'%')
+ </if>
+
+ <if test="gridPatrolRecord.neiName!=null and gridPatrolRecord.neiName!=''">
+ and br.name like concat('%',#{gridPatrolRecord.neiName},'%')
+ </if>
+
+ <if test="gridPatrolRecord.context!=null and gridPatrolRecord.context!=''">
+ and jgpr.context like concat('%',#{gridPatrolRecord.context},'%')
+ </if>
+ <if test="gridPatrolRecord.createUser!=null">
+ and jgpr.create_user = #{gridPatrolRecord.createUser}
+ </if>
+ and jgpr.is_deleted = 0
+ </where>
+
order by jgpr.id desc
</select>
+ <select id="selectGridPatrolRecordExport"
+ resultType="org.springblade.modules.grid.excel.GridPatrolRecordExcel">
+ select
+ jgpr.*,
+ bu.name as userName,
+ br.town_name as townStreetName,
+ br.name as neiName
+ FROM
+ jczz_grid_patrol_record jgpr
+ LEFT JOIN blade_user bu ON bu.id = jgpr.create_user
+ LEFT JOIN blade_dept bd ON bd.id = bu.dept_id
+ LEFT JOIN jczz_grid jg on jg.grid_code=jgpr.grid_code
+ LEFT JOIN blade_region br on br.code = jg.community_code
+ <where>
+ <if test="gridPatrolRecord.name!=null and gridPatrolRecord.name!=''">
+ and jgpr.name like concat('%',#{gridPatrolRecord.name},'%')
+ </if>
+
+ <if test="gridPatrolRecord.userName!=null and gridPatrolRecord.userName!=''">
+ and bu.name like concat('%',#{gridPatrolRecord.userName},'%')
+ </if>
+
+ <if test="gridPatrolRecord.townStreetName!=null and gridPatrolRecord.townStreetName!=''">
+ and br.town_name like concat('%',#{gridPatrolRecord.townStreetName},'%')
+ </if>
+
+ <if test="gridPatrolRecord.neiName!=null and gridPatrolRecord.neiName!=''">
+ and br.name like concat('%',#{gridPatrolRecord.neiName},'%')
+ </if>
+
+ <if test="gridPatrolRecord.context!=null and gridPatrolRecord.context!=''">
+ and jgpr.context like concat('%',#{gridPatrolRecord.context},'%')
+ </if>
+ <if test="gridPatrolRecord.createUser!=null">
+ and jgpr.create_user = #{gridPatrolRecord.createUser}
+ </if>
+ and jgpr.is_deleted = 0
+ </where>
+
+ order by jgpr.id desc
+
+ </select>
+
+
</mapper>
diff --git a/src/main/java/org/springblade/modules/grid/service/IGridPatrolRecordService.java b/src/main/java/org/springblade/modules/grid/service/IGridPatrolRecordService.java
index 24f4b23..36aa05e 100644
--- a/src/main/java/org/springblade/modules/grid/service/IGridPatrolRecordService.java
+++ b/src/main/java/org/springblade/modules/grid/service/IGridPatrolRecordService.java
@@ -18,9 +18,12 @@
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
+import org.springblade.modules.grid.excel.GridPatrolRecordExcel;
import org.springblade.modules.grid.vo.GridPatrolRecordVO;
import org.springblade.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage;
+
+import java.util.List;
/**
* 网格巡查记录表 服务类
@@ -39,5 +42,17 @@
*/
IPage<GridPatrolRecordVO> selectGridPatrolRecordPage(IPage<GridPatrolRecordVO> page, GridPatrolRecordVO gridPatrolRecord);
+ /**
+ * 新增
+ * @param gridPatrolRecord
+ * @return
+ */
+ boolean saveGridPatrolRecord(GridPatrolRecordEntity gridPatrolRecord);
+ /**
+ * 导出
+ * @param gridPatrolRecord
+ * @return
+ */
+ List<GridPatrolRecordExcel> export(GridPatrolRecordVO gridPatrolRecord);
}
diff --git a/src/main/java/org/springblade/modules/grid/service/impl/GridPatrolRecordServiceImpl.java b/src/main/java/org/springblade/modules/grid/service/impl/GridPatrolRecordServiceImpl.java
index 0580798..2516187 100644
--- a/src/main/java/org/springblade/modules/grid/service/impl/GridPatrolRecordServiceImpl.java
+++ b/src/main/java/org/springblade/modules/grid/service/impl/GridPatrolRecordServiceImpl.java
@@ -16,20 +16,26 @@
*/
package org.springblade.modules.grid.service.impl;
+import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
-import org.springblade.common.cache.SysCache;
import org.springblade.common.param.CommonParamSet;
import org.springblade.common.utils.AuthUtils;
+import org.springblade.common.utils.SpringUtils;
import org.springblade.core.secure.utils.AuthUtil;
+import org.springblade.modules.backblast.vo.BackblastPubRecordVO;
+import org.springblade.modules.grid.entity.GridEntity;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
-import org.springblade.modules.grid.vo.GridPatrolRecordVO;
+import org.springblade.modules.grid.excel.GridPatrolRecordExcel;
import org.springblade.modules.grid.mapper.GridPatrolRecordMapper;
import org.springblade.modules.grid.service.IGridPatrolRecordService;
-import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.grid.service.IGridService;
+import org.springblade.modules.grid.vo.GridPatrolRecordVO;
+import org.springblade.modules.police.entity.PoliceAffairsGridEntity;
+import org.springblade.modules.police.service.IPoliceAffairsGridService;
import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.Date;
import java.util.List;
/**
@@ -60,5 +66,54 @@
commonParamSet.getIsAdministrator()));
}
+ /**
+ * 新增网格巡查记录表
+ * @param gridPatrolRecord
+ * @return
+ */
+ @Override
+ public boolean saveGridPatrolRecord(GridPatrolRecordEntity gridPatrolRecord) {
+ gridPatrolRecord.setCreateTime(new Date());
+ gridPatrolRecord.setCreateUser(AuthUtil.getUserId());
+ // 设置网格信息
+ setGridInfo(gridPatrolRecord);
+ // 保存
+ return save(gridPatrolRecord);
+ }
+
+ /**
+ * 设置警格网格信息
+ * @param gridPatrolRecord
+ */
+ public void setGridInfo(GridPatrolRecordEntity gridPatrolRecord) {
+ // 根据位置设置网格,警格编号
+ IGridService gridService = SpringUtils.getBean(IGridService.class);
+ IPoliceAffairsGridService policeAffairsGridService = SpringUtils.getBean(IPoliceAffairsGridService.class);
+ String point = "'POINT(" + gridPatrolRecord.getLongitude() + " " + gridPatrolRecord.getLatitude() + ")'";
+ //点坐标解析网格
+ List<GridEntity> gridEntityList = gridService.spatialAnalysis(point);
+ if (gridEntityList.size()>0){
+ GridEntity gridEntity = gridEntityList.get(0);
+ gridPatrolRecord.setGridCode(gridEntity.getGridCode());
+ }
+ //点坐标解析警格
+ List<PoliceAffairsGridEntity> policeAffairsGridEntityList = policeAffairsGridService.spatialAnalysis(point);
+ if (policeAffairsGridEntityList.size()>0){
+ PoliceAffairsGridEntity policeAffairsGridEntity = policeAffairsGridEntityList.get(0);
+ gridPatrolRecord.setJwGridCode(policeAffairsGridEntity.getJwGridCode());
+ }
+ }
+
+ @Override
+ public List<GridPatrolRecordExcel> export(GridPatrolRecordVO gridPatrolRecord) {
+ CommonParamSet commonParamSet = new CommonParamSet<>().invoke(GridPatrolRecordVO.class, gridPatrolRecord);
+ if (!Strings.isBlank(gridPatrolRecord.getRoleName())){
+ gridPatrolRecord.setCreateUser(AuthUtil.getUserId());
+ }
+ return baseMapper.selectGridPatrolRecordExport(gridPatrolRecord,
+ commonParamSet.getIsAdministrator(),
+ commonParamSet.getRegionChildCodesList(),
+ commonParamSet.getGridCodeList());
+ }
}
diff --git a/src/main/java/org/springblade/modules/grid/vo/GridPatrolRecordVO.java b/src/main/java/org/springblade/modules/grid/vo/GridPatrolRecordVO.java
index e1ddd41..d8e3a8b 100644
--- a/src/main/java/org/springblade/modules/grid/vo/GridPatrolRecordVO.java
+++ b/src/main/java/org/springblade/modules/grid/vo/GridPatrolRecordVO.java
@@ -16,6 +16,7 @@
*/
package org.springblade.modules.grid.vo;
+import io.swagger.annotations.ApiModelProperty;
import org.springblade.modules.grid.entity.GridPatrolRecordEntity;
import org.springblade.core.tool.node.INode;
import lombok.Data;
@@ -32,14 +33,19 @@
public class GridPatrolRecordVO extends GridPatrolRecordEntity {
private static final long serialVersionUID = 1L;
- /**
- * 社区编号
- */
+ @ApiModelProperty(value = "社区编号", required = true)
private String communityCode;
- /**
- * 角色名称
- */
+ @ApiModelProperty(value = "角色名称", required = true)
private String roleName;
+ @ApiModelProperty(value = "巡查人名称", required = true)
+ private String userName;
+
+ @ApiModelProperty(value = "街道名称", required = true)
+ private String townStreetName;
+
+ @ApiModelProperty(value = "社区名称", required = true)
+ private String neiName;
+
}
diff --git a/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java b/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
index 0970bf2..7950cf4 100644
--- a/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
+++ b/src/main/java/org/springblade/modules/house/controller/UserHouseLabelController.java
@@ -202,6 +202,46 @@
}
/**
+ * 组织部标签统计
+ * @param householdLabel
+ * @param query
+ * @return
+ */
+ @GetMapping("/getOrgStatisticalLabels")
+ @ApiOperation(value = "组织部标签统计", notes = "")
+ public R<IPage<HouseholdLabelVO>> orgStatisticalLabels(HouseholdLabelVO householdLabel, Query query) {
+ IPage<HouseholdLabelVO> pages = householdLabelService.orgStatisticalLabels(Condition.getPage(query), householdLabel);
+ return R.data(pages);
+ }
+
+
+ /**
+ * 统战标签统计
+ * @param householdLabel
+ * @param query
+ * @return
+ */
+ @GetMapping("/getUnitedFrontStatisticalLabels")
+ @ApiOperation(value = "统战标签统计", notes = "")
+ public R<IPage<HouseholdLabelVO>> unitedFrontStatisticalLabels(HouseholdLabelVO householdLabel, Query query) {
+ IPage<HouseholdLabelVO> pages = householdLabelService.unitedFrontStatisticalLabels(Condition.getPage(query), householdLabel);
+ return R.data(pages);
+ }
+
+ /**
+ * 关注人员标签统计
+ * @param householdLabel
+ * @param query
+ * @return
+ */
+ @GetMapping("/getFollowStatisticalLabels")
+ @ApiOperation(value = "统战标签统计", notes = "")
+ public R<IPage<HouseholdLabelVO>> followStatisticalLabels(HouseholdLabelVO householdLabel, Query query) {
+ IPage<HouseholdLabelVO> pages = householdLabelService.followStatisticalLabels(Condition.getPage(query), householdLabel);
+ return R.data(pages);
+ }
+
+ /**
* 社区重点人员标签统计
* @param householdLabel
* @param query
diff --git a/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java b/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java
index b474b7e..494be64 100644
--- a/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java
+++ b/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.java
@@ -44,7 +44,23 @@
List<Integer> getUserLabelList(UserHouseLabelDTO userHouseLabelDTO);
- List<HouseholdLabelVO> statisticalLabels(IPage page, HouseholdLabelVO householdLabel);
+ List<HouseholdLabelVO> statisticalLabels(IPage page, @Param("householdLabel") HouseholdLabelVO householdLabel);
+
+ /**
+ * 组织部
+ * @param page
+ * @param householdLabel
+ * @return
+ */
+ List<HouseholdLabelVO> orgStatisticalLabels(IPage page, @Param("householdLabel") HouseholdLabelVO householdLabel);
+
+ /**
+ * 统战人员
+ * @param page
+ * @param householdLabel
+ * @return
+ */
+ List<HouseholdLabelVO> unitedFrontStatisticalLabels(IPage page, @Param("householdLabel") HouseholdLabelVO householdLabel);
List<HouseholdLabelVO> getCommunityStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel);
@@ -54,4 +70,6 @@
* @return
*/
List<UserHouseLabelEntity> getLabelList(@Param("labelNames") String labelName);
+
+ List<HouseholdLabelVO> followStatisticalLabels(IPage page, @Param("householdLabel") HouseholdLabelVO householdLabel);
}
diff --git a/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml b/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml
index 63f04ab..c17d2dd 100644
--- a/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml
+++ b/src/main/java/org/springblade/modules/house/mapper/UserHouseLabelMapper.xml
@@ -434,4 +434,423 @@
</select>
+
+ <select id="orgStatisticalLabels" resultType="org.springblade.modules.house.vo.HouseholdLabelVO">
+
+ SELECT
+ br.region_level,
+ br.`code` regionCode,
+ br.NAME regionName,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '24'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number1,(
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '25'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number2,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '26'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number3,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '27'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number4,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '28'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number5
+ FROM
+ `blade_region` br
+ WHERE
+ br.region_level = 4
+ AND br.city_code = 361100
+
+ </select>
+
+
+ <select id="unitedFrontStatisticalLabels" resultType="org.springblade.modules.house.vo.HouseholdLabelVO">
+ SELECT
+ br.region_level,
+ br.`code` regionCode,
+ br.NAME regionName,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1041'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number1,(
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1042'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number2,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1043'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number3,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1044'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number4,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1045'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number5,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1046'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number6,(
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1047'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number7,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1048'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number8,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1049'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number9,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1050'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number10,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1051'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number11,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1052'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number12
+ FROM
+ `blade_region` br
+ WHERE
+ br.region_level = 4
+ AND br.city_code = 361100
+
+ </select>
+
+ <select id="followStatisticalLabels" resultType="org.springblade.modules.house.vo.HouseholdLabelVO">
+ SELECT
+ br.region_level,
+ br.`code` regionCode,
+ br.NAME regionName,
+ (
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '1033'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number1,(
+ SELECT
+ count( 1 )
+ FROM
+ jczz_user_house_label juhl
+ LEFT JOIN jczz_label jl ON juhl.label_id = jl.id
+ WHERE
+ juhl.lable_type = 1
+ AND jl.id = '15'
+ AND juhl.household_id IS NOT NULL
+ AND juhl.house_code IN (
+ SELECT
+ jgr.house_code
+ FROM
+ jczz_grid jg
+ LEFT JOIN jczz_grid_range jgr ON jgr.grid_id = jg.id
+ LEFT JOIN jczz_community jc on jc.`code` = jg.community_code
+ WHERE
+ br.`code` = jc.`street_code`
+ )) number2
+ FROM
+ `blade_region` br
+ WHERE
+ br.region_level = 4
+ AND br.city_code = 361100
+
+ </select>
+
+
</mapper>
diff --git a/src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java b/src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java
index c996893..c3ec6d0 100644
--- a/src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java
+++ b/src/main/java/org/springblade/modules/house/service/IUserHouseLabelService.java
@@ -55,7 +55,29 @@
void importUserHouseLabel(List<UserHouseLabelExcel> data, Boolean isCovered);
+ /**
+ *
+ * @param page
+ * @param householdLabel
+ * @return
+ */
IPage<HouseholdLabelVO> statisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel);
+
+ /**
+ * 组织部
+ * @param page
+ * @param householdLabel
+ * @return
+ */
+ public IPage<HouseholdLabelVO> orgStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel);
+
+ /**
+ * 统战
+ * @param page
+ * @param householdLabel
+ * @return
+ */
+ public IPage<HouseholdLabelVO> unitedFrontStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel);
IPage<HouseholdLabelVO> getCommunityStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel);
@@ -72,4 +94,12 @@
* @return
*/
List<UserHouseLabelEntity> getLabelList(String labelName);
+
+ /**
+ * 关注
+ * @param page
+ * @param householdLabel
+ * @return
+ */
+ IPage<HouseholdLabelVO> followStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel);
}
diff --git a/src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java b/src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java
index 45ed5f7..197f5d3 100644
--- a/src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java
+++ b/src/main/java/org/springblade/modules/house/service/impl/UserHouseLabelServiceImpl.java
@@ -18,8 +18,10 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.logging.log4j.util.Strings;
+import org.springblade.common.utils.SpringUtils;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.modules.house.dto.UserHouseLabelDTO;
import org.springblade.modules.house.entity.UserHouseLabelEntity;
@@ -29,11 +31,13 @@
import org.springblade.modules.house.vo.HouseholdLabelVO;
import org.springblade.modules.label.entity.LabelEntity;
import org.springblade.modules.label.service.ILabelService;
+import org.springblade.modules.label.service.impl.LabelServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Objects;
+import java.util.stream.Collectors;
/**
* 住户-标签 服务实现类
@@ -100,6 +104,21 @@
}
@Override
+ public IPage<HouseholdLabelVO> orgStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel) {
+ return page.setRecords(baseMapper.orgStatisticalLabels(page, householdLabel));
+ }
+
+ @Override
+ public IPage<HouseholdLabelVO> unitedFrontStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel) {
+ return page.setRecords(baseMapper.unitedFrontStatisticalLabels(page, householdLabel));
+ }
+
+ @Override
+ public IPage<HouseholdLabelVO> followStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel) {
+ return page.setRecords(baseMapper.followStatisticalLabels(page, householdLabel));
+ }
+
+ @Override
public IPage<HouseholdLabelVO> getCommunityStatisticalLabels(IPage<HouseholdLabelVO> page, HouseholdLabelVO householdLabel) {
return page.setRecords(baseMapper.getCommunityStatisticalLabels(page, householdLabel));
}
diff --git a/src/main/java/org/springblade/modules/house/vo/HouseholdLabelVO.java b/src/main/java/org/springblade/modules/house/vo/HouseholdLabelVO.java
index 001f2e3..27e91cd 100644
--- a/src/main/java/org/springblade/modules/house/vo/HouseholdLabelVO.java
+++ b/src/main/java/org/springblade/modules/house/vo/HouseholdLabelVO.java
@@ -41,11 +41,6 @@
private String communityCode;
- // 刑释解教人员
-// 肇事肇祸精神障碍患者
-// 一般精神障碍患者
-// 重点对象
-// 取保候审
private Integer number1;
private Integer number2;
private Integer number3;
@@ -54,6 +49,10 @@
private Integer number6;
private Integer number7;
private Integer number8;
+ private Integer number9;
+ private Integer number10;
+ private Integer number11;
+ private Integer number12;
private List<Integer> ListId;
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
index 8777b93..8e082c3 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceCheckMapper.xml
@@ -104,6 +104,14 @@
and jpc.house_code = #{placeCheck.houseCode}
</if>
+ <if test="placeCheck.hiddenDangerNumber!=null and placeCheck.hiddenDangerNumber==0">
+ and jpc.hidden_danger_number = #{placeCheck.hiddenDangerNumber}
+ </if>
+
+ <if test="placeCheck.hiddenDangerNumber!=null and placeCheck.hiddenDangerNumber==1">
+ and jpc.hidden_danger_number > 0
+ </if>
+
<if test="placeCheck.streetName!=null and placeCheck.streetName!=''">
and br.town_name like concat('%', #{placeCheck.streetName},'%')
</if>
diff --git a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
index fa02706..318eea5 100644
--- a/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
+++ b/src/main/java/org/springblade/modules/place/mapper/PlaceMapper.xml
@@ -1110,7 +1110,7 @@
and jp.lng is not null
and jp.is_deleted = 0
HAVING distance <= 1
- ORDER BY distance limit 30
+ ORDER BY distance limit 60
</select>
</mapper>
diff --git a/src/main/java/org/springblade/modules/task/controller/TaskPlaceRectificationController.java b/src/main/java/org/springblade/modules/task/controller/TaskPlaceRectificationController.java
index 930d8de..7018052 100644
--- a/src/main/java/org/springblade/modules/task/controller/TaskPlaceRectificationController.java
+++ b/src/main/java/org/springblade/modules/task/controller/TaskPlaceRectificationController.java
@@ -204,10 +204,10 @@
/**
- * 民警审核
+ * 九小场所类型隐患数量统计
*/
@PostMapping("/rectificationStatistics")
- @ApiLog("民警审核")
+ @ApiLog("九小场所类型隐患数量统计")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "九小场所类型隐患数量统计", notes = "传入taskPlaceRectification")
public R rectificationStatistics(@Valid @RequestBody TaskPlaceRectificationVO taskPlaceRectification) {
diff --git a/src/main/java/org/springblade/modules/task/service/impl/TaskNoFraudReportingServiceImpl.java b/src/main/java/org/springblade/modules/task/service/impl/TaskNoFraudReportingServiceImpl.java
index 4496216..aa7e45d 100644
--- a/src/main/java/org/springblade/modules/task/service/impl/TaskNoFraudReportingServiceImpl.java
+++ b/src/main/java/org/springblade/modules/task/service/impl/TaskNoFraudReportingServiceImpl.java
@@ -129,10 +129,10 @@
String filePath;
FileInputStream file = null;
try {
- filePath = WordToPdfUtils.wordToPdf(item.getOriginalName(), item.getImageUrls());
- file = new FileInputStream(filePath);
- BladeFile bladeFile = ossBuilder.template().putFile(item.getOriginalName(), file);
- item.setPdfPath(bladeFile.getLink());
+ // filePath = WordToPdfUtils.wordToPdf(item.getOriginalName(), item.getImageUrls());
+ // file = new FileInputStream(filePath);
+ // BladeFile bladeFile = ossBuilder.template().putFile(item.getOriginalName(), file);
+ // item.setPdfPath(bladeFile.getLink());
} catch (Exception e) {
logger.error("生成pdf失败", e);
// throw new RuntimeException(e);
@@ -199,10 +199,10 @@
// 生成pdf
String filePath;
try {
- filePath = WordToPdfUtils.wordToPdf(taskPlaceRecordEntity.getOriginalName(), taskPlaceRecordEntity.getImageUrls());
- FileInputStream file = new FileInputStream(filePath);
- BladeFile bladeFile = ossBuilder.template().putFile(taskPlaceRecordEntity.getOriginalName(), file);
- taskPlaceRecordEntity.setPdfPath(bladeFile.getLink());
+ // filePath = WordToPdfUtils.wordToPdf(taskPlaceRecordEntity.getOriginalName(), taskPlaceRecordEntity.getImageUrls());
+ // FileInputStream file = new FileInputStream(filePath);
+ // BladeFile bladeFile = ossBuilder.template().putFile(taskPlaceRecordEntity.getOriginalName(), file);
+ // taskPlaceRecordEntity.setPdfPath(bladeFile.getLink());
} catch (Exception e) {
logger.error("生成pdf失败", e);
// throw new RuntimeException(e);
diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml
index 9be8104..5326ee3 100644
--- a/src/main/resources/application.yml
+++ b/src/main/resources/application.yml
@@ -256,7 +256,7 @@
- /jmreport/**
- /public_discuss/publicDiscuss/publicDiscussTotal
- /public_discuss/publicDiscuss/managementProtocol
- - /public_discuss/publicDiscuss/candidate
+ - /blade-place/place/getNearbyPlaceList
# - /blade-householdLabel/**
# - /blade-system/**
# - /blade-doorplateAddress/doorplateAddress/**
--
Gitblit v1.9.3